<% Option Explicit %>

<!--#include file="includes/cb_adovbs_sys.inc"-->
<!--#include file="includes/authority_sys.asp" -->
<!--#include file="includes/header_sys.asp"-->
<!--#include file="includes/generally_sys.asp"-->
<!--#include file="includes/fct_sys.inc"-->
<!--#include file="includes/body_calculation_sys.asp"-->
<!--#include file="includes/cb_measured_sys.inc"-->
<!--#include file="includes/measured_sys.asp"-->
<!--#include file="includes/translate.asp"-->
<!--#include file="includes/gwm_user_menu_dhx.asp"-->
<!--#include file="includes/athlete_measured_data.asp"-->
<!--#include file="Graphic/Includes/gwm_chart_procs.inc"-->

<%
on error resume next
'Codepage einstellen
Session.CodePage = 65001'Unicode, 8-bit encoding
Response.CharSet = "utf-8"

Dim show_auth
    show_auth = true

Dim defActiveTab, defContAreaClass
defActiveTab = Request("active_tab")
If ( ( defActiveTab <> "a1" ) and ( defActiveTab <> "a2" ) and ( defActiveTab <> "a3" ) ) Then
	defActiveTab = "a1"
End If
defContAreaClass = "contentmeasurytab_1_2"
'if ( defActiveTab = "a1" ) or ( defActiveTab = "a2" ) then
'	defContAreaClass = "contentmeasurytab_1_2"
'Else
'	defContAreaClass = "contentmeasurytab_3"
'End If

'Sprache -----------------------------------------------------------------
Dim i_lng
i_lng = Request("lng")
If IsEmpty(i_lng) or IsNull(i_lng) Then
	i_lng = Session("ses_i_language") 
end if
Session("ses_i_language")=i_lng'0=keine auswahl 1=german 2=english
'--------------------------------------------------------------------------
'Oeffnen der Datenbankverbindung
Dim objConn
Set objConn = Server.CreateObject("ADODB.Connection")
'Verbindung herstellen
objConn.open strComplete_sys

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 03 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'drop down infos ----------------------------------------------------------
'Const Con_Msg_07 = "...cm..."'dropdown im messform
'Const Con_Msg_07a = "...mm..."'dropdown im messform
'Const Con_Msg_08 = "...ft..."'dropdown im messform
'Const Con_Msg_09 = "...in..."'dropdown im messform
'Const Con_Msg_09a = ".../8in..."'dropdown im messform
'Const Con_Msg_09b = "../16in"'dropdown im messform
'Const Con_Msg_09c = "../32in"'dropdown im messform
'Const Con_Msg_09d = "...kg..."'dropdown im messform
'Const Con_Msg_09e = "...lbs.."'dropdown im messform

Dim str_Con_Msg_07'var_meas_at_42
Dim str_Con_Msg_07a'var_meas_at_43
Dim str_Con_Msg_08'var_meas_at_44
Dim str_Con_Msg_09'var_meas_at_45
Dim str_Con_Msg_09a'var_meas_at_46
Dim str_Con_Msg_09b'var_meas_at_47
Dim str_Con_Msg_09c'var_meas_at_48
Dim str_Con_Msg_09d'var_meas_at_49
Dim str_Con_Msg_09e'var_meas_at_50

str_Con_Msg_07 = fc_value_string(Session("ses_i_language"), "var_meas_at_42")
str_Con_Msg_07a = fc_value_string(Session("ses_i_language"), "var_meas_at_43")
str_Con_Msg_08 = fc_value_string(Session("ses_i_language"), "var_meas_at_44")
str_Con_Msg_09 = fc_value_string(Session("ses_i_language"), "var_meas_at_45")
str_Con_Msg_09a = fc_value_string(Session("ses_i_language"), "var_meas_at_46")
str_Con_Msg_09b = fc_value_string(Session("ses_i_language"), "var_meas_at_47")
str_Con_Msg_09c = fc_value_string(Session("ses_i_language"), "var_meas_at_48")
str_Con_Msg_09d = fc_value_string(Session("ses_i_language"), "var_meas_at_49")
str_Con_Msg_09e = fc_value_string(Session("ses_i_language"), "var_meas_at_50")

'Errormeldung ----------------------------------------------------------
Dim str_Con_Msg_26'var_meas_at_33
Dim str_Con_Msg_27'var_meas_at_34
Dim str_Con_Msg_27a'var_meas_at_35
Dim str_Con_Msg_27b'var_meas_at_35
'Dim str_Con_Msg_27c'var_meas_at_37  >> wird von str_var_meas_at_51 und str_var_meas_at_52 ersetzt
Dim str_Con_Msg_27d'var_meas_at_38
Dim str_Con_Msg_27f'var_meas_at_39
Dim str_Con_Msg_28'var_meas_at_40
'Dim str_Con_Msg_29'var_glob_txt_1028
Dim str_Con_Msg_30' var_meas_at_41

'20130324
'zb. Das gewählte Datum liegt mehr als [245] Monate zurück und ist damit ausserhalb der Eingabfrist.
Dim str_var_meas_at_51
Dim str_var_meas_at_52
Dim i_month_diff'die Monate differenz von heute zum eingabemonat
Dim dt_now_diff

str_Con_Msg_26 = fc_value_string(Session("ses_i_language"), "var_meas_at_33")
str_Con_Msg_27 = fc_value_string(Session("ses_i_language"), "var_meas_at_34")
str_Con_Msg_27a = fc_value_string(Session("ses_i_language"), "var_meas_at_35")
str_Con_Msg_27b = fc_value_string(Session("ses_i_language"), "var_meas_at_35")
'str_Con_Msg_27c = fc_value_string(Session("ses_i_language"), "var_meas_at_37")
str_Con_Msg_27d = fc_value_string(Session("ses_i_language"), "var_meas_at_38")
str_Con_Msg_27f = fc_value_string(Session("ses_i_language"), "var_meas_at_39")
str_Con_Msg_28 = fc_value_string(Session("ses_i_language"), "var_meas_at_40")
'str_Con_Msg_29 = fc_value_string(Session("ses_i_language"), "var_glob_txt_1028")
str_Con_Msg_30 = fc_value_string(Session("ses_i_language"), "var_meas_at_41")

str_var_meas_at_51 = fc_value_string(Session("ses_i_language"), "var_meas_at_51")
str_var_meas_at_52 = fc_value_string(Session("ses_i_language"), "var_meas_at_52")

'Hints-------------------------------------------------------------------
Dim hint_title_127
Dim hint_127
hint_title_127 = fc_value_string_hint_title(Session("ses_i_language"), "var_hints_01", "var_hints_30")
hint_127 = fc_value_string(Session("ses_i_language"), "var_hints_30")

Dim hint_title_128
Dim hint_128
hint_title_128 = fc_value_string_hint_title(Session("ses_i_language"), "var_hints_01", "var_hints_31")
hint_128 = fc_value_string(Session("ses_i_language"), "var_hints_31")

Dim hint_title_129
Dim hint_129
hint_title_129 = fc_value_string_hint_title(Session("ses_i_language"), "var_hints_01", "var_hints_32")
hint_129 = fc_value_string(Session("ses_i_language"), "var_hints_32")

Dim hint_title_130
Dim hint_130
hint_title_130 = fc_value_string_hint_title(Session("ses_i_language"), "var_hints_01", "var_hints_33")
hint_130 = fc_value_string(Session("ses_i_language"), "var_hints_33")
'-------------------------------------------------------------------------
Dim str_line_header'Sergey ... Messwerte pro Seite
str_line_header = fc_value_string(Session("ses_i_language"), "var_meas_at_28")
'-------------------------------------------------------------------------
'Hints für die Icon wer hat was eingegeben ... Übersicht ganz unten
Dim var_hints_34'Eingegeben durch Junior-Athlete
var_hints_34 = fc_value_string(Session("ses_i_language"), "var_hints_34")
Dim var_hints_35'Eingegeben durch authorisierten Trainer
var_hints_35 = fc_value_string(Session("ses_i_language"), "var_hints_35")
Dim var_hints_34_35'wird pro datensatz entschieden
'-------------------------------------------------------------------------

'AUTHORIZATIONS PAGE: Hints Icon---------------------------------------------------------------
Dim var_hints_08, var_autho_09, var_autho_10, var_autho_11
var_hints_08 = fc_value_string(Session("ses_i_language"), "var_hints_08")
var_autho_09 = fc_value_string(Session("ses_i_language"), "var_autho_09")
var_autho_10 = fc_value_string(Session("ses_i_language"), "var_autho_10")
var_autho_11 = fc_value_string(Session("ses_i_language"), "var_autho_11")
'--------------------------------------------------------------------------

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Ende Andrey Info 03 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Dim i_dyna_pro_seite
i_dyna_pro_seite = 50

'überprüft ob es eine eingabe von einem trainer ist ------------------
Dim i_lock_menu
i_lock_menu = 0 'normale eingabe vom athleten

Dim iua'userid des athleten
Dim iut'userid des trainers
Dim iun'der name des athleten

Dim iu
Dim ig
Dim isx
iu = Session("ses_iu")
ig = Session("ses_ig")
isx = Session("ses_i_isx")
If IsNull(isx) or IsEmpty(isx) Then
	isx = 0
end if

Dim piua, piut 'public id of athlete and trainer passed by post parameter (concatenated str_log_id and str_master_id fields of tbl_0101_master_id)
               'to make impossible viewing the estimation of any athlete by the fraudster by changing the post parameters
               'I'd suggest to decline using iua and iut parameters and use piua and piut and then remove iua and iut reading from the Request

iua = Request("iua")
If IsNull(iua) or IsEmpty(iua) Then
	iua = 0
end if
iut = Request("iut")
If IsNull(iut) or IsEmpty(iut) Then
	iut = 0
end if

piua = Request("piua")
If ( not IsNull(piua) ) and ( not IsEmpty(piua) ) and ( piua <> "" ) Then
	iua = GetUserIdByPublicId(objConn, piua)
	piut = Request("piut")
	If ( not IsNull(piut) ) and ( not IsEmpty(piut) ) and ( piut <> "" ) Then
		iut = GetUserIdByPublicId(objConn, piut)
	Else
		iut = Session("ses_iu")
	End If
Else
	piua = GetUserPublicId(objConn, iu)
End If

If iua > 0 and iut > 0 Then
	iu = iua
	ig = 5
	isx = 0
	i_lock_menu = 1 ' eingabe vom trainer
End If

'Response.Write("iua: " & iua & "<br>")
'Response.Write("iut: " & iut & "<br>")
'Response.End()
iun = Request("iun")
'Response.Write("iun: " & iun & "<br>")

'call showMessage(isx)
'isx = 0 >> keine neue stammdateneingabe übers login
'isx = 2 >> neue head org stammdateneingabe übers login
'isx = 3 >> neue org stammdateneingabe übers login
'isx = 4 >> neue trainer stammdateneingabe übers login
'isx = 5 >> neue athlete stammdateneingabe übers login	
If Session("ses_dev")=1 Then'0 >> normalbetrieb - 1 > Applikation im entwicklungsstatus - nur für testbetrieb - es werden wichtige var ausgegeben
'Response.Write("ses_i_isx: " & isx & "<br>")
end if
'----------------------------------------------------------------------
'Response.Write("iu: " & iu & "<br>")
'Pruefen, ob der User eingeloggt ist
If iu = 0 and ig = 0 Then
   'User ist nicht eingeloggt, daher zu Login Seite schicken
   Response.Redirect "session_end.asp"
   Response.End
End If

Dim lng_fk_User_ID_update'der user der datensatz anlegt

If i_lock_menu = 1 Then
	lng_fk_User_ID_update = iut'die user id des trainers
else
	lng_fk_User_ID_update = iu'der eingeloggte athlete
end if
'Response.Write("iu: " & iu & "<br>")
'Response.Write("ig: " & ig & "<br>")
'Response.End()
'----------------------------------------------------------------------
Dim rst
Dim rst_tmp
Dim objRS 
Dim queryStr
'----------------------------------------------------------------------
Dim str_title
str_title = Session("ses_title")
'----------------------------------------------------------------------

Dim i_fk_measured_type_default'voreingestellt durch user
'funktioniert denn diese s ession wird nur beim anmelden aktualisiert
'i_fk_measured_type_default = Session("ses_i_measured_system")

'das voreingestellte messsytem wird ermittelt
i_fk_measured_type_default = 1'metric default
queryStr = "SELECT i_fk_measured_system FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type ='" & 1 & "'"
'Response.Write(queryStr & "<br>")
Set rst_tmp = Server.CreateObject("ADODB.RecordSet")
rst_tmp.Open queryStr, objConn, adOpenStatic, adLockReadOnly  
If Not rst_tmp.EOF Then
	i_fk_measured_type_default = rst_tmp.Fields("i_fk_measured_system").Value
end if
rst_tmp.Close 
set rst_tmp = Nothing

'Response.Write("i_fk_measured_type_default: " & i_fk_measured_type_default & "<br>")

'überprüft welches datumsformat eingestellt ist -------------------------------------------------
Dim i_fk_date_format
Dim dt_birthday
Dim dt_birthday_js'für java
Dim i_zaehler_date
Dim i_day
Dim i_year
Dim i_month

SQL = "SELECT i_fk_date_format, dt_birthday FROM tbl_0501_user WHERE lng_k_User_ID = '" & iu & "'"

Set rst_tmp = Server.CreateObject("ADODB.Recordset")
rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   
    If Not rst_tmp.EOF Then
        i_fk_date_format = rst_tmp.Fields("i_fk_date_format").Value
		dt_birthday = rst_tmp.Fields("dt_birthday").Value
		dt_birthday_js = fc_str_date_Server_format(dt_birthday, 2) 
    End if
	rst_tmp.Close
set rst_tmp = Nothing
If IsNull(i_fk_date_format) or Isempty(i_fk_date_format) Then
	i_fk_date_format = 1'default
end if
'--------------------------------------------------------------------------------------------------------
Dim i_fk_measured_system_new
'datumsformat
'1	dd.mm.yyyy
'2	mm.dd.yyyy
'das ausgewählte messsystem wird ermittelt
'i_fk_measured_system
'0	+++please select+++
'1	metric			
'2	feet - inch -1/8
'3	feet - inch -1/16
'4	feet - inch -1/32
SQL = "SELECT i_fk_measured_system FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "'  AND i_fk_measured_type = '" & 1 & "'"
Set rst_tmp = Server.CreateObject("ADODB.Recordset")
rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   
    If Not rst_tmp.EOF Then
        i_fk_measured_system_new = rst_tmp.Fields("i_fk_measured_system").Value
    End if
	rst_tmp.Close
set rst_tmp = Nothing

If IsNull(i_fk_measured_system_new) or IsEmpty(i_fk_measured_system_new) or i_fk_measured_system_new = 0 Then
	i_fk_measured_system_new = i_fk_measured_type_default
end if
'Response.Write("i_fk_date_format: " & i_fk_date_format & "<br>")
Dim i_bmi_min
Dim i_bmi_max
Dim i_bmi_ok
i_bmi_min=Con_i_bmi_min
i_bmi_max=Con_i_bmi_max
i_bmi_ok=0

Dim i_filter_passive
i_filter_passive = Request("optR01")
If i_filter_passive = "" Then
	i_filter_passive = 1
end if

' Get reminder variables
Dim lng_k_athlete'tbl_0401_athlete
lng_k_athlete = fc_lng_foreign_key(iu, 4)
'lng_k_athlete = 1000
sql = "SELECT * FROM tbl_0970_reminder_schedule WHERE lng_k_athlete = '"&lng_k_athlete&"'"
Set rst_tmp = Server.CreateObject("ADODB.Recordset")
Dim g_time_zone, g_first_email, g_second_email, g_next_mease, g_interval, g_days_ahead, g_pause, g_diff_first_email, g_diff_second_email
rst_tmp.Open sql, objConn, adOpenStatic, adLockReadOnly   
    If Not rst_tmp.EOF Then
        g_time_zone = rst_tmp.Fields("time_zone").Value
        g_first_email = rst_tmp.Fields("first_email").Value
        g_diff_first_email = rst_tmp.Fields("diff_first_email").Value
        g_second_email = rst_tmp.Fields("second_email").Value
        g_diff_second_email = rst_tmp.Fields("diff_second_email").Value
        g_next_mease = rst_tmp.Fields("next_mease").Value
        g_interval = rst_tmp.Fields("interval").Value
        g_days_ahead = rst_tmp.Fields("days_ahead").Value
        g_pause = rst_tmp.Fields("pause").Value
    End if
	rst_tmp.Close
set rst_tmp = Nothing

tab3_save()

'--------------------------------------------------------------------------

dim chartScriptRelPath
chartScriptRelPath = "Graphic/"

'The variable for hidden passing of the graph "setting id" to the growmetry_calculation.asp script
dim pfx_id
pfx_id = Int ( Rnd() * 1000000 ) + 1

If Err.Number Then
	Response.Write("<h2>Unexpected error (1). Please contact Technical Support.")
	Err.Clear
End If

Session("chart_settings_id" & pfx_id) = getChartActiveSettingsId(objConn)
Session("dbAlias") = "db2"

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/vorlage_std_all.dwt" codeOutsideHTMLIsLocked="false" -->
<!-- ----------------------------------------------------------- -->
<!--       Beratung, Projektierung, Webdesign und Umsetzung      -->
<!--                     www.on-designs.com                      -->
<!-- Christian Freidl, Gärtnerweg 6, 8073 Neuseiersberg, Austria -->
<!-- ----------------------------------------------------------- -->
<!-- ----------------------------------------------------------- -->
<!--        Beratung, Projektierung, ASP-Programmierung          -->
<!--                     www.bribase.com                         -->
<!--                    Peter Brislinger,                        -->
<!--        Paul-Anton-Keller-Gasse 23, 8073 Feldkirchen         -->
<!-- ----------------------------------------------------------- -->
<head>
<% CALL writeGwmCustomHeaders %>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- InstanceBeginEditable name="doctitle" -->
<title><%= str_title %> - Data Input</title>
<!-- InstanceEndEditable -->
<LINK REL="SHORTCUT ICON" HREF="http://www.growmetry.com/favicon.ico">
<meta name="author" content="Programming by Peter Brislinger, http://www.bribase.com | Web & Interfacedesign by Christian Freidl, http://www.on-designs.com">
<meta name="robots" content="noindex, nofollow">
<meta name="audience" content="all">
<style type="text/css">
<!--
A:link, A:visited, A:active {text-decoration: none; color:#333333}
A:hover {text-decoration: underline}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	SCROLLBAR-FACE-COLOR: #ffffff; 
	SCROLLBAR-HIGHLIGHT-COLOR: #ffffff;
	SCROLLBAR-SHADOW-COLOR: #cccccc;
	SCROLLBAR-3DLIGHT-COLOR: #cccccc;
	SCROLLBAR-ARROW-COLOR: #666666;
	SCROLLBAR-TRACK-COLOR: #ffffff;
	SCROLLBAR-DARKSHADOW-COLOR: #ffffff
}
-->
</style>
<link href="../css/growmetry.css" rel="stylesheet" type="text/css" />

<script src="includes/dhtmlxSuite/dhtmlxAccordion/codebase/dhtmlxcommon.js"></script>
<script src="includes/dhtmlxSuite/dhtmlxAccordion/codebase/dhtmlxcontainer.js"></script>

<script src="includes/dhtmlxSuite/dhtmlxTabbar/codebase/dhtmlxtabbar.js"></script>
<link rel="STYLESHEET" type="text/css" href="includes/dhtmlxSuite/dhtmlxTabbar/codebase/dhtmlxtabbar.css">

<link rel="stylesheet" type="text/css" href="includes/dhtmlxSuite/dhtmlxCalendar/codebase/dhtmlxcalendar.css"></link>
<link rel="stylesheet" type="text/css" href="includes/dhtmlxSuite/dhtmlxCalendar/codebase/skins/dhtmlxcalendar_dhx_skyblue.css"></link>
<script type="text/javascript" src="includes/dhtmlxSuite/dhtmlxCalendar/sources/dhtmlxcalendar_gwm_v2.js"></script>



<!-- InstanceBeginEditable name="head" -->
<script type="text/javascript" language="JavaScript">
	var consts = {
		pfx_id: <%=pfx_id %>,
		chartScriptRelPath: "<%=chartScriptRelPath %>",
		lng_id: <%=i_lng %>,
		pid: "<%=piua %>"
	}
	var bgEstInProgress = false;
	
	function checkEstInProgress(evt) {
		var message = "Background biological age estimation is still in progress. In will be broken if you leave the page.";
		if (typeof evt == "undefined") {
			evt = window.event;
		}
		if (evt) {
			evt.returnValue = message;
		}
		return message;
	}
	
    function runBgEstimation() {
    	if ( bgEstInProgress ) {
    		window.setTimeout(runBgEstimation, 100);
    	} else {
    		window.onbeforeunload = checkEstInProgress;
    		bgEstInProgress = true;
	        var url = consts.chartScriptRelPath + "growmetry_calculation.asp?pfx_id=" + consts.pfx_id + "&lng_id=" + consts.lng_id + "&pid=" + escape(consts.pid) + "&rnd=" + Math.round(Math.random() * 10000),
	            req = null,
	            ani_el = document.getElementById('bg-calc-ani');
	        if (window.XMLHttpRequest) {
	            req = new XMLHttpRequest();
	            // branch for IE/Windows ActiveX version
	        } else if (window.ActiveXObject) {
	            try {
	                req = new ActiveXObject('Msxml2.XMLHTTP');
	            }
	            catch (e) {
	                try {
	                    req = new ActiveXObject('Microsoft.XMLHTTP');
	                }
	                catch (e) {
	                }
	            }
	        }
	        if (req) {
	            var do_process_request = function(succ) {
	            	window.onbeforeunload = null;
	                bgEstInProgress = false;
	                ani_el.src = "images/ico/chart_pie16.png";
	                ani_el.style.display = "none";
	            };
	            var on_req_ready = function() {
	                try {
	                    // only if req shows "complete"
	                    if (req.readyState === 4) {
	                        // only if "OK"
	                        do_process_request(req.status === 200);
	                    }
	                }
	                catch (e) {
	                    do_process_request(false);
	                }
	            };
	
	            var on_req_error = function() {
	                do_process_request(false);
	            };
	
	            req.onreadystatechange = on_req_ready;
	            if (window.XMLHttpRequest) {
	                req.onerror = on_req_error;
	            }
	
	            ani_el.src = "images/chart_pie16_animated.gif";
                ani_el.style.display = "";
	            req.open("GET", url, true);
	            req.send(null);
	        }
	    }
    }
    

</script>

<style type="text/css">
<!--
.Stil8 {color: #AA0000}
.Stil9 {color: #FF0000}
.Stil10 {color: #006600}
.Stil11 {color: #999999}
.Stil12 {color: #666666}
.Stil14 {font-family: Wingdings}
.paginator {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 12px;
}
.yellow {
    background-color: #FFF2C1;
}
-->
</style>
<%
	'include scripts for the menu
	CALL userMenuAddScripts
%>
<script type="text/javascript">

    //-------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------
    window.onload = refresh_window
    //-------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------
    function refresh_window() {

    }
    //-------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------
    function go_back(i) {
        var go_back_01 = "main_menu.asp"
        location.href = go_back_01;
    }

    function check_save(i) {
        if (i == "1")//save
        {
            document.frm_value_3.btnSub.value = "S";
        }
    }

    function Form_inputcheck(theForm) {

        var lng_fk_authorizations_01 = document.frm_value_3.LST_Authorizations_01.value;
        var lng_fk_authorizations_02 = document.frm_value_3.LST_Authorizations_02.value;
        var lng_fk_authorizations_03 = document.frm_value_3.LST_Authorizations_03.value;
        var lng_fk_authorizations_04 = document.frm_value_3.LST_Authorizations_04.value;
        //alert(lng_fk_authorizations_01);

        //#1 = #2
        if (lng_fk_authorizations_01 > "0" && lng_fk_authorizations_02 > "0" && lng_fk_authorizations_01 == lng_fk_authorizations_02) {
            //alert(str_info_301);
            alert('<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>');
            //alert("1");
            return (false);
        }

        //#1 = #3
        if (lng_fk_authorizations_01 > "0" && lng_fk_authorizations_03 > "0" && lng_fk_authorizations_01 == lng_fk_authorizations_03) {
            //alert(str_info_301);
            alert('<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>');
            //alert("2");
            return (false);
        }

        //#1 = #4
        if (lng_fk_authorizations_01 > "0" && lng_fk_authorizations_04 > "0" && lng_fk_authorizations_01 == lng_fk_authorizations_04) {
            //alert(str_info_301);
            alert('<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>');
            //alert("3");
            return (false);
        }

        //#2 = #3
        if (lng_fk_authorizations_02 > "0" && lng_fk_authorizations_03 > "0" && lng_fk_authorizations_02 == lng_fk_authorizations_03) {
            //alert(str_info_301);
            alert('<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>');
            //alert("4");
            return (false);
        }

        //#2 = #4
        if (lng_fk_authorizations_02 > "0" && lng_fk_authorizations_04 > "0" && lng_fk_authorizations_02 == lng_fk_authorizations_04) {
            //alert(str_info_301);
            alert('<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>');
            //alert("5");
            return (false);
        }

        //#3 = #4
        if (lng_fk_authorizations_03 > "0" && lng_fk_authorizations_04 > "0" && lng_fk_authorizations_03 == lng_fk_authorizations_04) {
            //alert(str_info_301);
            alert('<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>');
            //alert("6");
            return (false);
        }

    }

    function getDom(id) {
        return document.getElementById(id);
    }

    function email_onchange(obj) {
        var emailFieldDiv;
        if (obj.id == 'prime_email') {
            emailFieldDiv = getDom('diff_email_1_div');
            if (obj.value == '-1') {
                emailFieldDiv.style.display = '';
            } else {
                emailFieldDiv.style.display = 'none';
                getDom('diff_email_1').value = '';
            }
        } else {
            emailFieldDiv = getDom('diff_email_2_div');
            if (obj.value == '-1') {
                emailFieldDiv.style.display = '';
            } else {
                emailFieldDiv.style.display = 'none';
                getDom('diff_email_2').value = '';
            }
        }
    }

    var g_diff_first_email = "<%= g_diff_first_email %>";
    var g_diff_second_email = "<%= g_diff_second_email %>";
    var g_pause = "<%= g_pause %>";

    function saveReminder() {
        var email_valid_pattern = new RegExp(/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/);
        var email_1 = getDom('prime_email').value;
        var diff_first_email = 0;
        if (email_1 == '-1') {
            email_1 = getDom('diff_email_1').value;
            diff_first_email = 1;
        }
        if (!email_valid_pattern.test(email_1)) {
            alert('Invalid first email address!');
            return false;
        }
        var diff_second_email = 0;
        var email_2 = getDom('second_email').value;
        if (email_2 == '-1') {
            email_2 = getDom('diff_email_2').value;
            diff_second_email = 1;
        }
        if (email_2 != "0" && (!email_valid_pattern.test(email_2))) {
            alert('Invalid second email address!');
            return false;
        }
        var  next_measurement = getDom('next_measurement').value;
        var date_pattern = new RegExp(/^[0-9]{2}\.[0-9]{2}\.[0-9]{4}$/);
        if (!date_pattern.test(next_measurement)) {
            alert('Please select next scheduled measurement!');
            return false;
        }
        var params = 'action=saveReminder&timezone=' + getDom('timezone').value + '&prime_email=' + email_1 + '&diff_first_email = ' + diff_first_email
     + '&second_email=' + email_2 + '&diff_second_email = ' + diff_second_email + '&next_measurement=' + next_measurement
     + '&interval_plan=' + getDom('interval_plan').value + '&remind_me=' + getDom('remind_me').value
     + '&pause=' + getDom('pause').checked;
        dhtmlxAjax.post("athlete_measured_data_ajax.asp", params, function (loader) {
            var resp = loader.xmlDoc.responseText;
            if (resp.substr(0, 1) == '{') {
                var json = eval("(" + resp + ")");
                if (json && typeof json === 'object') {
                    if (json.status == 'error') {
                        alert("Error: " + json.msg);
                    } else {
                        if (json.msg != '' && json.msg != undefined) {
                            alert(json.msg);
                        } else {
                            if (json.iu == '0' && json.ig == '0') {
                                window.location.href = "session_end.asp";
                            } else {

                            }
                        }
                    }
                } else {
                    alert('Unknown request error occured');
                }
            } else {
                alert('Error requesting the data. Error: ' + loader.xmlDoc.responseText);
            }
        });
    }

    function pauseReminder(obj) {
        var reminderObjects = {
            timezone: getDom('timezone'),
            prime_email: getDom('prime_email'),
            diff_email_1: getDom('diff_email_1'),
            second_email: getDom('second_email'),
            diff_email_2: getDom('diff_email_2'),
            next_measurement: getDom('next_measurement'),
            interval_plan: getDom('interval_plan'),
            remind_me: getDom('remind_me')
        };
        var disabled = obj.checked;
        for (var key in reminderObjects) {
            reminderObjects[key].disabled = disabled;
            reminderObjects[key].style.color = (disabled?"grey":"black");
        }
    }
</script>
<!--TABBAR related code-->
<script type="text/javascript">
	var tabbar, tabbarskin = "modern", tabCount = 3;

	function createTabs(){
		tabbar = new dhtmlXTabBar("a_tabbar", "top");
		tabbar.setSkin('modern');
		tabbar.setImagePath("includes/dhtmlxSuite/dhtmlxTabbar/codebase/imgs/");
		tabbar.addTab("a1", "<%= fc_value_string(Session("ses_i_language"), "var_meas_at_53") %>", "150px");
		tabbar.addTab("a2", "<%= fc_value_string(Session("ses_i_language"), "var_meas_at_54") %>", "170px");
		tabbar.addTab("a3", "<%= fc_value_string(Session("ses_i_language"), "var_meas_at_55") %>", "200px");
		tabbar.attachEvent("onSelect", function(a) {
			switchContTabs(a);
			for(var i=1; i<=tabCount; i++) {
				document.getElementById("tabbar-page-lhs-text-a" + i).style.display = (("a" + i == a)?"":"none");					
			}
			return true;
		});
		tabbar.setTabActive("<%= defActiveTab%>");
	}
	
	function switchContTabs(actTab) {
		for(var i=1; i<=tabCount; i++) {
			if ( i != actTab )
				document.getElementById('page-enclosure-a' + i).style.display = 'none';
		}
		document.getElementById('page-enclosure-' + actTab).style.display = '';
		document.getElementById('contAreaBgEl').className = 'contentmeasurytab_1_2';
//		document.getElementById('contAreaBgEl').className = 'contentmeasurytab_' + (actTab == 'a3'?'3':'1_2');
        if (actTab == 'a1'){
            error_msg(0);
        }
	}
	
</script>
<!-- InstanceEndEditable -->

</head>

<body>
<script type="text/javascript" src="includes/wz_tooltip.js"></script>
<script type="text/javascript" language="JavaScript">
function change_language(i)
{
    var query = "athlete_measured_data.asp?";
    var params = get_page_params();
    params.lng = i;
    params.active_tab = tabbar.getActiveTab();
    for (var j in params){
        if (j != "_" && j != 'action'){
            query += j + "=" + params[j] + "&";
        }
    }
    query = query.substr(0, query.length - 1);
    window.location.href = query;
}

//sucht einen String innerhalb eines Strings (Andrey)
function get_page_params() 
{
       function unspace( qs_element ) {
               return qs_element.split( '+' ).join( ' ' );
       }
       var QueryString = new Array();
       QueryString["_"]="";
       if ( location.search.length > 1 ) {
               var qs_query = location.search.substring( 1, location.search.length );
               var qs_pairs = qs_query.split( '&' );
               for ( var qs_index = 0; qs_index < qs_pairs.length; qs_index++ ) {
                       var qs_element = qs_pairs[qs_index].split( '=' );
                       QueryString[qs_element[0]] = unspace( unescape( qs_element[1] ) );
               }
       }
       return QueryString;

}


</SCRIPT>  
<style type="text/css">
    .contentmeasurytab_1_2{
        background-image: url(../App/images/standard/fog_ath_meas_tab1.jpg);
    }
</style>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" class="backout">
<table width="950" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="700" valign="top" background="../App/images/standard/filler_vert.gif"><table width="950" border="0" cellpadding="0" cellspacing="0" class="<%= fc_value_string(Session("ses_i_language"), "var_glob_bitm_20") %>">
<tr>
<td width="25" height="90">&nbsp;</td>
<td width="900" height="90">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="bottom"><div align="right" class="txtsm">
</div>
<div align="right">
<div align="right" class="txtsm"></div>
</div>

<div align="right"><span class="txtloginasgrey"><%=Session("ses_txt_logininfo_z01")%></span><span class="txtloginasred"><strong><%=Session("ses_str_User_name")%></strong></span>
<span class="txtloginasgrey"> <%= fc_value_string(Session("ses_i_language"), "var_glob_txt_1009") %> <a href="index.asp"><%= fc_value_string(Session("ses_i_language"), "var_glob_txt_02") %></a></span><br/>
<strong class="txtloginasgreen"><%=Session("ses_txt_logininfo_z02")%> </strong><br/>
<span class="txtloginasgrey"><%=Session("ses_txt_logininfo_z03")%></span><br/>
</div>
</td>
</tr>
</table>
</td>
<td width="25" height="90">&nbsp;</td>
</tr>
<tr>
<td width="25">&nbsp;</td><!-- InstanceBeginEditable name="Edit_navi" -->
<script src="includes/constant.js"></script>
<script type="text/javascript" language="JavaScript">
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
window.onload = function() {
	createTabs();
    calendar = new dhtmlXCalendarObject("next_measurement");
    calendar.setDateFormat("%d.%m.%Y");
    if (g_diff_first_email == "1"){
        getDom('prime_email').value = "-1";
    }
    if (g_diff_second_email == "1"){
        getDom('second_email').value = "-1";
    }
    email_onchange(getDom('prime_email'));
    email_onchange(getDom('second_email'));
    if (g_pause == "true"){
        getDom('pause').checked = true;
        pauseReminder(getDom('pause'));
    }
	refresh_window();
}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//wenn die optionsfelder zum filtern betätigt werden
function refresh_window_filter(i)
{
//refresh_measured_sytem();
//refresh_birthday();
//error_msg(0);

//alert(i);

	if (i = 1)
	{
	window.location.href = "athlete_measured_data.asp?active_tab=a2&optR01=1#listing";
	} 
	if (i = 2)
	{
	window.location.href = "athlete_measured_data.asp?active_tab=a2&optR01=2#listing";
	} 
}

function refresh_window()
{
    if (tabbar.getActiveTab() == 'a1'){
        refresh_measured_sytem();
        refresh_birthday();
        error_msg(0);
    }
}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
function error_msg(i) {
    var strFehler='';

	if (document.frm_value.i_insert_error.value > "0") {
        //strFehler += str_measured_info;
        strFehler +="<%= fc_value_string(Session("ses_i_language"), "var_java_93") %>";
	} 

    //BMI -------------------------------------------------------
    var i_bmi=document.frm_value.i_bmi.value;
    var i_bmi_min=<%= i_bmi_min %>;
    var i_bmi_max=<%= i_bmi_max %>;
    i_bmi = i_bmi.replace(/[,]/,'.');  // ersetze Komma mit Punkt

	if (i_bmi < i_bmi_min && document.frm_value.i_bmi.value.length>0 && i_bmi>0)
	{
        //alert(str_info_203 + i_bmi);
        //2011 10 26 lt. hans deaktiviert
        //strFehler += str_info_203 + i_bmi;
	} 
	if (i_bmi > i_bmi_max && document.frm_value.i_bmi.value.length>0 && i_bmi>0)
	{
        //alert(str_info_203 + i_bmi);
        //mit BMI Wert
        //2011 10 26 lt. hans deaktiviert
        //strFehler += str_info_203 + i_bmi;

        //ohne BMI Wert
        //2011 10 26 lt. hans deaktiviert
        //strFehler += str_info_203
	} 

	//wieder auf normal setzen
	document.frm_value.i_bmi.value=<%= i_bmi_ok %>
	
//BMI Ende -------------------------------------------------
	
	if (strFehler.length>0)
	{
        //alert("Festgestellte Probleme: \n\n"+strFehler);
        alert(strFehler);
        document.frm_value.i_insert_error.value = 0;
        //return(false);
	}
}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//function Form_inputcheck(theForm)
//{
//
//}

function gueltigesDatum (datum)
{
//return 0 oder return 1
//0=False
//1=True

    //(Schritt 1) Fehlerbehandlung
 if (!datum) return 0;
 datum=datum.toString();

    //(Schritt 2) Aufspaltung des Datums
 datum=datum.split("-");
 if (datum.length!=3) return 0;

    //(Schritt 3) Entfernung der fuehrenden Nullen und Anpassung des Monats

 datum[0]=parseInt(datum[0],10);
 datum[1]=parseInt(datum[1],10)-1;

    //(Schritt 4) Behandlung Jahr nur zweistellig
 if (datum[2].length==2) datum[2]="20"+datum[2];

    //(Schritt 5)??††x? Erzeugung eines neuen Dateobjektes
 var kontrolldatum=new Date(datum[2],datum[1],datum[0]);

//übergibt das kontrollierte datum 
 //	if (i_value == "A")
//	{
//		 gl_dt_new = kontrolldatum;
//	}
// 	if (i_value == "B")
//	{
//		 gl_dt_birth = kontrolldatum;
//	}
// 	if (i_value == "C")
//	{
//		 gl_dt_min = kontrolldatum;
//	}


//alert(i_value)
 
    //(Schritt 6) Vergleich, ob das eingegebene Datum gleich dem JS-Datum ist
 if (kontrolldatum.getDate()==datum[0] && kontrolldatum.getMonth()==datum[1] && kontrolldatum.getFullYear()==datum[2])
     return 1; else return 0;

}

//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
function go_back(i)
{
var go_back_01 ="main_menu.asp"
location.href=go_back_01;
}

function check_save(i)
{
	if (i == "1")//save
	{
	document.frm_value.btnSub.value = "S";
	} 
	if (i == "2")//Passive
	{
	document.frm_value.btnSub.value = "P";
	} 

}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------

//Athlete Messdatum
function refresh_birthday()
{
var i_date_format = document.frm_value.i_fk_date_format.value;
var i_day
var i_month
var i_year
var dt_date

//alert(i_date_format)
//
//1	dd.mm.yyyy
//2	mm.dd.yyyy
	if (i_date_format == "1")
	{
		i_day = document.frm_value.LST_day_01.value;
			if (i_day.length == "1")
			{
			i_day = "0" + i_day
			}
		i_month = document.frm_value.LST_month_01.value;
			if (i_month.length == "1")
			{
			i_month = "0" + i_month
			}
		i_year = document.frm_value.LST_year_01.value;
		dt_date = i_day + "-" + i_month + "-" + i_year;
		document.frm_value.dt_measured_new.value = dt_date;
		
	}

	if (i_date_format == "2")
	{
		i_day = document.frm_value.LST_day_02.value;
			if (i_day.length == "1")
			{
			i_day = "0" + i_day
			}
		i_month = document.frm_value.LST_month_02.value;
			if (i_month.length == "1")
			{
			i_month = "0" + i_month
			}
		i_year = document.frm_value.LST_year_02.value;
		dt_date = i_day + "-" + i_month + "-" + i_year;
		document.frm_value.dt_measured_new.value = dt_date;
		
	}

}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------

function get_metric_value_drop_down(i)
//onchange="javascript: get_metric_value_drop_down(1)"
{
var i_value_index
var i_value_metric

	if (i == "1")
	{
		i_value_index = document.frm_value.LST_cm_m01.value;
	}

	//alert(i_value_index)

		i_value_metric = get_value_drop_down(i_value_index);
	//alert(i_value_metric)

}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//Größernerfassung
function refresh_measured_sytem()
{

//voreingestellter wert durch user (stammdaten)	
	if (document.frm_value.i_fk_measured_type_default == "")
	{
		var i_measured_sytem = "1";//metric
	}
	if (document.frm_value.i_fk_measured_type_default == "0")
	{
		var i_measured_sytem = "1";//metric
	}

var i_measured_sytem = document.frm_value.i_fk_measured_sytem?document.frm_value.i_fk_measured_sytem.value:"";

	
	if (i_measured_sytem == "")
	{
		var i_measured_sytem = document.frm_value.i_fk_measured_type_default.value;
		//i_measured_sytem = "1";
	}

	if (i_measured_sytem == "0")
	{
		var i_measured_sytem = document.frm_value.i_fk_measured_type_default.value;
		//i_measured_sytem = "1";
	}

//metric
	if (i_measured_sytem == "1")
	{
		//messung#1
		document.getElementById("tab_cm_m01").style.display="";
		document.getElementById("tab_feet_08_m01").style.display="none";
		document.getElementById("tab_feet_16_m01").style.display="none";
		document.getElementById("tab_feet_32_m01").style.display="none";
		
		document.getElementById("tab_kg_m01").style.display="";
		document.getElementById("tab_lbs").style.display="none"; 

		//messung#2
		document.getElementById("tab_cm_m02").style.display="";
		document.getElementById("tab_feet_08_m02").style.display="none";
		document.getElementById("tab_feet_16_m02").style.display="none";
		document.getElementById("tab_feet_32_m02").style.display="none";

		//messung#3
		document.getElementById("tab_cm_m03").style.display="";
		document.getElementById("tab_feet_08_m03").style.display="none";
		document.getElementById("tab_feet_16_m03").style.display="none";
		document.getElementById("tab_feet_32_m03").style.display="none";
	}

//feet + 1/8
	if (i_measured_sytem == "2")
	{
		//messung#1
		document.getElementById("tab_cm_m01").style.display="none";
		document.getElementById("tab_feet_08_m01").style.display="";
		document.getElementById("tab_feet_16_m01").style.display="none";
		document.getElementById("tab_feet_32_m01").style.display="none";
		
		document.getElementById("tab_kg_m01").style.display="none";
		document.getElementById("tab_lbs").style.display=""; 

		//messung#2
		document.getElementById("tab_cm_m02").style.display="none";
		document.getElementById("tab_feet_08_m02").style.display="";
		document.getElementById("tab_feet_16_m02").style.display="none";
		document.getElementById("tab_feet_32_m02").style.display="none";

		//messung#3
		document.getElementById("tab_cm_m03").style.display="none";
		document.getElementById("tab_feet_08_m03").style.display="";
		document.getElementById("tab_feet_16_m03").style.display="none";
		document.getElementById("tab_feet_32_m03").style.display="none";
	}

//feet + 1/16
	if (i_measured_sytem == "3")
	{
		//messung#1
		document.getElementById("tab_cm_m01").style.display="none";
		document.getElementById("tab_feet_08_m01").style.display="none";
		document.getElementById("tab_feet_16_m01").style.display="";
		document.getElementById("tab_feet_32_m01").style.display="none";
		
		document.getElementById("tab_kg_m01").style.display="none";
		document.getElementById("tab_lbs").style.display=""; 

		//messung#2
		document.getElementById("tab_cm_m02").style.display="none";
		document.getElementById("tab_feet_08_m02").style.display="none";
		document.getElementById("tab_feet_16_m02").style.display="";
		document.getElementById("tab_feet_32_m02").style.display="none";

		//messung#3
		document.getElementById("tab_cm_m03").style.display="none";
		document.getElementById("tab_feet_08_m03").style.display="none";
		document.getElementById("tab_feet_16_m03").style.display="";
		document.getElementById("tab_feet_32_m03").style.display="none";
	}

//feet + 1/32
	if (i_measured_sytem == "4")
	{
		//messung#1
		document.getElementById("tab_cm_m01").style.display="none";
		document.getElementById("tab_feet_08_m01").style.display="none";
		document.getElementById("tab_feet_16_m01").style.display="none";
		document.getElementById("tab_feet_32_m01").style.display="";
		
		document.getElementById("tab_kg_m01").style.display="none";
		document.getElementById("tab_lbs").style.display=""; 

		//messung#2
		document.getElementById("tab_cm_m02").style.display="none";
		document.getElementById("tab_feet_08_m02").style.display="none";
		document.getElementById("tab_feet_16_m02").style.display="none";
		document.getElementById("tab_feet_32_m02").style.display="";

		//messung#3
		document.getElementById("tab_cm_m03").style.display="none";
		document.getElementById("tab_feet_08_m03").style.display="none";
		document.getElementById("tab_feet_16_m03").style.display="none";
		document.getElementById("tab_feet_32_m03").style.display="";
	}

}
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------------
//-->

function auth_form_inputcheck(theForm)
{

var lng_fk_authorizations_01= document.frm_value.LST_Authorizations_01.value;
var lng_fk_authorizations_02= document.frm_value.LST_Authorizations_02.value;
var lng_fk_authorizations_03= document.frm_value.LST_Authorizations_03.value;
var lng_fk_authorizations_04= document.frm_value.LST_Authorizations_04.value;
//alert(lng_fk_authorizations_01);

//#1 = #2
	if (lng_fk_authorizations_01 > "0" && lng_fk_authorizations_02 > "0" && lng_fk_authorizations_01 == lng_fk_authorizations_02)
	{
		//alert(str_info_301);
		alert("<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>");
		//alert("1");
		return(false);
	}

//#1 = #3
	if (lng_fk_authorizations_01 > "0" && lng_fk_authorizations_03 > "0" && lng_fk_authorizations_01 == lng_fk_authorizations_03)
	{
		//alert(str_info_301);
		alert("<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>");
		//alert("2");
		return(false);
	}

//#1 = #4
	if (lng_fk_authorizations_01 > "0" && lng_fk_authorizations_04 > "0" && lng_fk_authorizations_01 == lng_fk_authorizations_04)
	{
		//alert(str_info_301);
		alert("<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>");
		//alert("3");
		return(false);
	}

//#2 = #3
	if (lng_fk_authorizations_02 > "0" && lng_fk_authorizations_03 > "0" && lng_fk_authorizations_02 == lng_fk_authorizations_03)
	{
		//alert(str_info_301);
		alert("<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>");
		//alert("4");
		return(false);
	}

//#2 = #4
	if (lng_fk_authorizations_02 > "0" && lng_fk_authorizations_04 > "0" && lng_fk_authorizations_02 == lng_fk_authorizations_04)
	{
		//alert(str_info_301);
		alert("<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>");
		//alert("5");
		return(false);
	}

//#3 = #4
	if (lng_fk_authorizations_03 > "0" && lng_fk_authorizations_04 > "0" && lng_fk_authorizations_03 == lng_fk_authorizations_04)
	{
		//alert(str_info_301);
		alert("<%= fc_value_string(Session("ses_i_language"), "var_autho_08") %>");
		//alert("6");
		return(false);
	}

}


</script>
<% 
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 01 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Dim bol_objConn
bol_objConn = False		

Dim AP'>>>  Seitenindex der masterseite (all)
AP = Request("ap")
If AP = "" Then
	AP = 1 
end if

Dim trancd
Dim btnSub_01
Dim btnSub_02
Dim btnSub_03

'btnSub_01 = Save >> 1
'btnSub_02 = reset >> 2
'btnSub_03 = seite neue laden >> 3

btnSub_01 = Request("btnSub_01") 
btnSub_02 = Request("btnSub_02") 
btnSub_03 = Request("btnSub_03") 
trancd = "A"'default

'Save - update
If Len(btnSub_01) > 0 and Len(btnSub_02) = 0 and Len(btnSub_03) = 0 Then
	trancd = "S"
end if
'reset oder clear
If Len(btnSub_01) = 0 and Len(btnSub_02) > 0 and Len(btnSub_03) = 0 Then
	trancd = "R"
end if
'ladet die seite neu
If Len(btnSub_01) = 0 and Len(btnSub_02) = 0 and Len(btnSub_03) > 0 Then
	trancd = "L"	
end if

'Response.Write("trancd: " & trancd & "<br>")
'20100126 mit Grafik
'New Record >> N
'Change Master Access Code >> C
Dim input_grafik
input_grafik = Request("btnSub")
'Response.Write("#3 input_grafik: " & input_grafik & "<br>")

If trancd = "A" and Len(input_grafik) > 0 Then'möglicherweise wurde eine Grafik betätigt
	trancd = UCase(Left(Request("btnSub"),1))
	'Response.Write("#2 trancd: " & trancd & "<br>")
	'falls nicht betätigt wurde bleibt A
	'S > save ... bestehnder datensatz speichern
	If instr("SP", trancd) = 0 Then
    	trancd = "A"
  	End If
End If

'Response.Write("trancd: " & trancd & "<br>")
'---------------------------------------------------------------------------------------------------------------------------------------
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Ende Andrey Info 01 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 02 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


bol_objConn = True

Dim sql_tmp
Dim lst_wert
Dim lst_string

Dim dt_measured_new
'messreihe #1 >> die wichtigste
Dim i_insert_error'0= kein fehler >0=fehler
'messreihe #2 >> nur wenn alle dafür wichtigen dropdowns ausgewählt wurde
Dim i_insert_error_messung_02'0= kein fehler >0=fehler
'messreihe #3 >> nur wenn alle dafür wichtigen dropdowns ausgewählt wurde
Dim i_insert_error_messung_03'0= kein fehler >0=fehler
'Dim str_insert_error_date
	
Dim sql_new
Dim sql_new_01
Dim sql_new_02
Dim sql_new_03

Dim i_count_new

	dt_measured_new = Request("dt_measured_new")
	If Isdate(dt_measured_new) Then
	else
		dt_measured_new = Now()
	end if
	
	dt_measured_new = fc_str_date_Server_format(dt_measured_new, 3)

	If IsNull(dt_measured_new) or IsEmpty(dt_measured_new) Then
		dt_measured_new = fc_str_date_server_format(Now(), 3)
		'Response.Write("#1 dt_measured_new: " & dt_measured_new & "<br>")
	end if

	i_day = Day(dt_measured_new)
		'Response.Write("i_day: " & i_day & "<br>")
	i_month	= Month(dt_measured_new)
		'Response.Write("i_month: " & i_month & "<br>")
	i_year = Year(dt_measured_new)
		'Response.Write("i_year: " & i_year & "<br>")


Dim dt_measured
Dim ID_dt_measured
Dim ID_dt_measured_x
Dim ckk_i_passive_x
Dim i_passive
Dim i_dyna_counter

Dim objRS_save		
Dim i_Count
Dim i_zaehler

Dim id_dyna'die datensatz des zu bearbeiteten datensatzes
id_dyna = Request("id")
'Response.Write("id: " & id & "<br>")	

Dim str_select
'--------------------------------------------------------------------------------------------------
Dim SQL
'die drei messungen
Dim lng_fk_cm_m01
Dim lng_fk_cm_deci_m01
Dim lng_fk_feet_m01
Dim lng_fk_inch_m01
Dim lng_fk_eighths_inch_m01
Dim lng_fk_sixteenth_inch_m01
Dim lng_fk_thirtysecond_inch_m01

Dim lng_fk_cm_m02
Dim lng_fk_cm_deci_m02
Dim lng_fk_feet_m02
Dim lng_fk_inch_m02
Dim lng_fk_eighths_inch_m02
Dim lng_fk_sixteenth_inch_m02
Dim lng_fk_thirtysecond_inch_m02

Dim lng_fk_cm_m03
Dim lng_fk_cm_deci_m03
Dim lng_fk_feet_m03
Dim lng_fk_inch_m03
Dim lng_fk_eighths_inch_m03
Dim lng_fk_sixteenth_inch_m03
Dim lng_fk_thirtysecond_inch_m03

Dim lng_kg_01
Dim lng_fk_lbs_01

'die letzte messung
Dim lng_fk_cm_m01_last
Dim lng_fk_cm_m02_last
Dim lng_fk_cm_m03_last
Dim lng_kg_01_last
Dim lng_fk_lbs_01_last

'2012 11 18 lt. hans deaktiviert
'der beeich im dropdown der angezeigt werden soll
'Dim i_range_min
'Dim i_range_max

Dim dt_measured_last
Dim str_insert_error_msg'der text der im form angezeigt wird falls es einen fehler gibt

Dim dbl_measured_mm_athlete_01
Dim dbl_measured_mm_athlete_02
Dim dbl_measured_mm_athlete_03

Dim dbl_measured_mm_athlete_average'der berechnete durchschnittswert
Dim str_measured_mm_athlete_average'der ausgabe durchschnittswert
Dim dbl_measured_kg

'überprüft ob eine auswahl getroffen wurd -  wichtig für die durchschnittsberechnung
Dim id_01'0=keine auswahl 1=ok
Dim id_02
Dim id_03

Dim dt_now
Dim dt_dat_min
Dim dt_dat_max
Dim dt_dat_min_back_default
Dim i_month_back_user 'vorgabewert die in einer tabelle <tbl_0515_measured_period_default>
Dim i_month_back_value'der wert der für die Berechnung verwendet wird (entweder <Con_i_month_back> oder <i_month_back_user>)
Dim dt_retcon_date
Dim dt_date_calculation'das datum mit dem gewünschte Format für Andrey
'20120318
Dim i_systempassiv'1=die daten werden für Andrey auf pasiv gesetzt/Default = 0
i_systempassiv =0

Dim i_month_back_user_info'für die Anzeige vor der liste
Dim i_year_back'die jahreszahl für dropdowns zum eingeben für das datum

i_month_back_user = fc_get_measured_month_back()	

'berechnet das Jahr wie weit der der User zurück eingeben kann
'******************************************************************************
'2011 03 19 die einstellungen sind in einer Tabelle <tbl_0515_measured_period_default> hinterlegt
'wenn in dieser tabelle nichts gefunden wird dann wirde der defaultwert genommen
'gibt den Default Zeitraum für rückwirkende Einagben für diesen User (Athleten) user zurück
'Function fc_get_measured_month_back()

				If i_month_back_user <> Con_i_month_back and i_month_back_user < 0 Then
					i_month_back_value = i_month_back_user
				else
					i_month_back_value = Con_i_month_back 
				end if
				
i_month_back_user_info = i_month_back_value * -1
'Response.Write("i_month_back_user_info: " & i_month_back_user_info & "<br>")
				
'Response.Write("#3 i_month_back_value: " & i_month_back_value & "<br>")
				dt_now = Now()
				dt_dat_min_back_default = DateAdd("m", i_month_back_value, dt_now)
				dt_dat_min_back_default = fc_str_date_Server_format(dt_dat_min_back_default, 3) 

'Response.Write("#1 dt_dat_min_back_default: " & dt_dat_min_back_default & "<br>")	

				i_year_back = Year(dt_dat_min_back_default)	
'Response.Write("#1 i_year_back: " & i_year_back & "<br>")

'für die meldungsausgabe wenn der messzeitpunkz zu weit zurück liegt
				dt_now_diff = fc_str_date_Server_format(Now, 3)
				i_month_diff = 0
				'i_month_diff = DateDiff( "m", #01/01/2000#, Now)'OK
				i_month_diff = DateDiff( "m", dt_measured_new, dt_now_diff)
				
'Response.Write("#1a dt_measured_new: " & dt_measured_new & "<br>")
'Response.Write("#1a dt_now_diff: " & dt_now_diff & "<br>")
'Response.Write("#1a i_month_diff: " & i_month_diff & "<br>")
'******************************************************************************	

 
If trancd = "S" Then'speichert den neuen datensatz
		
'Const Con_Msg_26 = "(26) Incorrect DATE entry!"
'Const Con_Msg_27 = "(27) This DATE has been previously registered!"
		
			str_insert_error_msg = ""
			i_insert_error = 0
			
			dt_measured_new = Request("dt_measured_new")
			
			If Isdate(dt_measured_new) Then
				dt_measured_new = fc_str_date_Server_format(dt_measured_new, 3)
			else
				i_insert_error = 1
				str_insert_error_msg = "-" & str_Con_Msg_26
			end if
			
			'es dürfen keine messdaten vor dem 5. geburtstag eingegeben werden--------------------------------------
			'es dürfen keine messdaten nach dem 21. geburtstag eingegeben werden------------------------------------
			'es dürfen keine messdaten eingegeben werden die älter als 2 monate sind--------------------------------
			'es dürfen keine messdaten eingegeben die in der zukunft liegen-----------------------------------------
			'dt_birthday
			
			If Isdate(dt_measured_new) Then
				dt_now = Now()
				dt_now = fc_str_date_Server_format(dt_now, 3) 
				
				dt_dat_min = DateAdd("yyyy", Con_i_year_min, dt_birthday)
				dt_dat_min = fc_str_date_Server_format(dt_dat_min, 3) 
				
				dt_dat_max = DateAdd("yyyy", Con_i_year_max, dt_birthday)
				dt_dat_max = fc_str_date_Server_format(dt_dat_max, 3) 
				
				'2011 02 07 auf wunsch von hans
				'2011 02 16 wieder alles auf 2 Monate gesetzt
				'2011 03 15 auf wunsch hans >> david kager
'2011 03 19 deaktiviert
				'If iu = 446 or iu = 96 Then'Thomas STREIN(446)>>sksturm - Thompson Kevin(96)>>my Golf
'				If iu = 311 or iu = 96 Then'David Kager(311)>>sksturm - Thompson Kevin(96)>>my Golf
'					dt_dat_min_back_default = DateAdd("m", Con_i_month_back_06, dt_now)
'				else
'					dt_dat_min_back_default = DateAdd("m", Con_i_month_back, dt_now)
'				end if
''******************************************************************************
''wird weiter oben berechnet
''2011 03 19 die einstellungen sind in einer Tabelle <tbl_0515_measured_period_default> hinterlegt
''wenn in dieser tabelle nichts gefunden wird dann wirde der defaultwert genommen
''gibt den Default Zeitraum für rückwirkende Einagben für diesen User (Athleten) user zurück
''Function fc_get_measured_month_back()
'
'				If i_month_back_user <> Con_i_month_back and i_month_back_user < 0 Then
'					i_month_back_value = i_month_back_user
'				else
'					i_month_back_value = Con_i_month_back 
'				end if
'				
''Response.Write("#3 i_month_back_value: " & i_month_back_value & "<br>")
'				dt_dat_min_back_default = DateAdd("m", i_month_back_value, dt_now)
'				dt_dat_min_back_default = fc_str_date_Server_format(dt_dat_min_back_default, 3) 
'
'Response.Write("#1 dt_dat_min_back_default: " & dt_dat_min_back_default & "<br>")		
''******************************************************************************	

'				Response.Write("#1 dt_now: " & dt_now & "<br>")				
'				Response.Write("#1 dt_measured_new: " & dt_measured_new & "<br>")
'				Response.Write("dt_dat_min: " & dt_dat_min & "<br>")
'				Response.Write("dt_dat_max: " & dt_dat_max & "<br>")
'				Response.Write("dt_dat_min_back_default: " & dt_dat_min_back_default & "<br>")

'Const Con_Msg_27a = "Das eingegebene Datum darf nicht vor dem 5. Geburtstag liegen!"
'Const Con_Msg_27b = "Das eingegebene Datum darf nicht nach dem 21. Geburtstag liegen!"
'Const Con_Msg_27c = "Das eingegebene Datum darf nicht nach älter als zwei Monate sein!"
'Const Con_Msg_27d = "Das eingegebene Datum darf nicht in der Zukunft liegen!"
				
				If dt_dat_min > dt_measured_new Then
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_27a  & "<br>"
					i_insert_error = 1
				end if
				
				If dt_dat_max < dt_measured_new Then
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_27b  & "<br>"
					i_insert_error = 1
				end if

				If dt_dat_min_back_default > dt_measured_new Then
					'str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_27c  & "<br>"
					'zb. Das gewählte Datum liegt mehr als [245] Monate zurück und ist damit ausserhalb der Eingabfrist.
					str_insert_error_msg = str_insert_error_msg & "-" & str_var_meas_at_51 & " " & i_month_diff  & " " & str_var_meas_at_52 & "<br>"
					i_insert_error = 1
				end if

				If dt_now < dt_measured_new Then
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_27d  & "<br>"
					i_insert_error = 1
				end if
				
			end if
			
'überprüft ob es für diesen Tag schon eine Eingabe gibt ------------------------------------------------
'i_fk_measured_type
'1	Master Athlete
'2	Master Mother
'3	Master Father
'4	Calculate Athlete
			If Isdate(dt_measured_new) Then
				'i_number_of_changes = 0 >> bedeutet das ist der aktuelle datensatz
				sql_tmp = "SELECT COUNT(1) AS i_count FROM tbl_0801_athlete_measured " & _
				"WHERE lng_fk_User_ID = '" & iu & "' " & _
				"AND dt_measured = '" & dt_measured_new & "' " & _
				"AND i_fk_measured_type = '" & 4 & "'" & _
				"AND i_number_of_changes = '" & 0 & "'"
				
'				Response.Write(sql_tmp & "<br>")
'				Response.End()
				
				i_count_new = 0
				Set rst_tmp = Server.CreateObject("ADODB.RecordSet")
				rst_tmp.Open sql_tmp, objConn, adOpenStatic, adLockReadOnly 
					i_count_new = rst_tmp.Fields("i_count")
				rst_tmp.Close
				set rst_tmp = Nothing
				
				If Cint(i_count_new) > 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_27  & "<br>"
				end if
			end if

'			If Isdate(dt_measured_new) Then
'				dt_measured_new = fc_str_date_server_format(dt_measured_new, 3)
'			end if
			
'			If Cint(i_insert_error) > 0 Then
'				call showMessage(str_Con_Msg_29)
'			end if'If Cint(i_insert_error) > 0 Then

'i_fk_measured_type
'1	Master Athlete
'2	Master Mother
'3	Master Father
'4	Calculate Athlete

'i_fk_measured_system
'0	+++please select+++	1
'1	metric				2
'2	feet - inch -1/8	3
'3	feet - inch -1/16	4
'4	feet - inch -1/32	5

'test
'i_insert_error = 1
'messung #1	---------------------------------------------------------------	
			If i_fk_measured_system_new = 1 Then'metric
				lng_fk_cm_m01 = Request("LST_cm_m01")
				lng_fk_cm_deci_m01 = Request("LST_cm_deci_m01")
				lng_kg_01 = Request("LST_kg")

				dbl_measured_mm_athlete_01 = fc_get_metric_value(lng_fk_cm_m01)
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_cm_deci_m01))
				dbl_measured_mm_athlete_01 = dbl_measured_mm_athlete_01 * 10
				dbl_measured_kg = fc_get_metric_value(lng_kg_01)
				
				If lng_fk_cm_m01 > 0 or lng_fk_cm_m01 > 0 Then
					id_01 = 1
				else
					id_01 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_feet_m01 = 0
				lng_fk_inch_m01 = 0
				lng_fk_eighths_inch_m01 = 0
				lng_fk_sixteenth_inch_m01 = 0
				lng_fk_thirtysecond_inch_m01 = 0
				lng_fk_lbs_01 = 0
			end if

			If i_fk_measured_system_new = 2 Then'feet - inch -1/8
				lng_fk_feet_m01 = Request("LST_feet_08_m01")
				lng_fk_inch_m01 = Request("LST_inch_08_m01")
				lng_fk_eighths_inch_m01 = Request("LST_eighths_inch_m01")
				lng_fk_lbs_01 = Request("LST_lbs")
				
				dbl_measured_mm_athlete_01 = fc_get_metric_value(lng_fk_feet_m01)
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_inch_m01))
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_eighths_inch_m01))
				dbl_measured_kg = fc_get_metric_value(lng_fk_lbs_01)
				
				If lng_fk_feet_m01 > 0 or lng_fk_inch_m01 > 0 or lng_fk_eighths_inch_m01 > 0 Then
					id_01 = 1
				else
					id_01 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m01 = 0
				lng_fk_cm_deci_m01 = 0
				lng_kg_01 = 0
				lng_fk_sixteenth_inch_m01 = 0
				lng_fk_thirtysecond_inch_m01 = 0
			end if
			
			If i_fk_measured_system_new = 3 Then'feet - inch -1/16
				lng_fk_feet_m01 = Request("LST_feet_16_m01")
				lng_fk_inch_m01 = Request("LST_inch_16_m01")
				lng_fk_sixteenth_inch_m01 = Request("LST_sixteenth_m01")
				lng_fk_lbs_01 = Request("LST_lbs")
				
				dbl_measured_mm_athlete_01 = fc_get_metric_value(lng_fk_feet_m01)
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_inch_m01))
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_sixteenth_inch_m01))
				dbl_measured_kg = fc_get_metric_value(lng_fk_lbs_01)
				
				If lng_fk_feet_m01 > 0 or lng_fk_inch_m01 > 0 or lng_fk_sixteenth_inch_m01 > 0 Then
					id_01 = 1
				else
					id_01 = 0
				end if
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m01 = 0
				lng_fk_cm_deci_m01 = 0
				lng_kg_01 = 0
				lng_fk_eighths_inch_m01 = 0
				lng_fk_thirtysecond_inch_m01 = 0
			end if

			If i_fk_measured_system_new = 4 Then'feet - inch -1/32
				lng_fk_feet_m01 = Request("LST_feet_32_m01")
				lng_fk_inch_m01 = Request("LST_inch_32_m01")
				lng_fk_thirtysecond_inch_m01 = Request("LST_thirtysecond_inch_m01")
				lng_fk_lbs_01 = Request("LST_lbs")
				
				dbl_measured_mm_athlete_01 = fc_get_metric_value(lng_fk_feet_m01)
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_inch_m01))
				dbl_measured_mm_athlete_01 = (dbl_measured_mm_athlete_01 ) + (fc_get_metric_value(lng_fk_thirtysecond_inch_m01))
				dbl_measured_kg = fc_get_metric_value(lng_fk_lbs_01)
				dbl_measured_kg = fc_get_metric_value(lng_fk_lbs_01)
				
				If lng_fk_feet_m01 > 0 or lng_fk_inch_m01 > 0 or lng_fk_thirtysecond_inch_m01 > 0 Then
					id_01 = 1
				else
					id_01 = 0
				end if

				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m01 = 0
				lng_fk_cm_deci_m01 = 0
				lng_kg_01 = 0
				lng_fk_eighths_inch_m01 = 0
				lng_fk_sixteenth_inch_m01 = 0
			end if

'überprüfung der eingabe --------------------------------------------------------------------------------------
'i_fk_measured_system
'0	+++please select+++	
'1	metric			
'2	feet - inch -1/8	
'3	feet - inch -1/16	
'4	feet - inch -1/32		

'Const Con_Msg_26 = "Incorrect DATE entry!" OK
'Const Con_Msg_27 = "Data for this DATE have already been entered!" OK
'Const Con_Msg_28 = "(28) Missing input measurement # 1!"
'Const str_Con_Msg_29 = "(29) An error was encountered with this ENTRY. Please see meassage box!" OK
'Const Con_Msg_30 = "(30) Missing input measurement Weight!"

			If i_fk_measured_system_new = 1 Then'metric
				'größe
				If lng_fk_cm_m01 = 0 or lng_fk_cm_deci_m01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_28 & "<br>"
					id_01 = 0' id_01 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
				'gewicht
				If lng_kg_01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_30 & "<br>"
				end if	
			end if	

			If i_fk_measured_system_new = 2 Then'feet - inch -1/8
				'größe
				If lng_fk_feet_m01 = 0 or lng_fk_inch_m01 = 0 or lng_fk_eighths_inch_m01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_28 & "<br>"
					id_01 = 0' id_01 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
				'gewicht
				If lng_fk_lbs_01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_30 & "<br>"
				end if	
			end if	
			
			If i_fk_measured_system_new = 3 Then'feet - inch -1/16
				'größe
				If lng_fk_feet_m01 = 0 or lng_fk_inch_m01 = 0 or lng_fk_sixteenth_inch_m01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_28 & "<br>"
					id_01 = 0' id_01 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
				'gewicht
				If lng_fk_lbs_01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_30 & "<br>"
				end if	
			end if	

			If i_fk_measured_system_new = 4 Then'feet - inch -1/32
				'größe
				If lng_fk_feet_m01 = 0 or lng_fk_inch_m01 = 0 or lng_fk_thirtysecond_inch_m01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_28 & "<br>"
					id_01 = 0' id_01 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
				'gewicht
				If lng_fk_lbs_01 = 0 Then
					i_insert_error = i_insert_error + 1
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_30 & "<br>"
				end if	
			end if	
			
'---------------------------------------------------------------------------------------------------------------
					sql_new_01 = "INSERT INTO tbl_0801_athlete_measured " & _
					 "(" & _
							" lng_fk_User_ID" & _
							", dt_measured" & _
							", i_fk_measured_type" & _
							", i_measured_series" & _
							", i_fk_measured_system" & _
							", lng_fk_cm" & _
							", lng_fk_cm_deci" & _
							", lng_fk_feet" & _
							", lng_fk_inch" & _
							", lng_fk_eighths_inch" & _
							", lng_fk_sixteenth_inch" & _
							", lng_fk_thirtysecond_inch" & _
							", lng_fk_kg" & _
							", lng_fk_kg_deci" & _
							", lng_fk_lbs" & _
							", i_fk_status" & _
							", lng_fk_User_ID_update" & _
					  ") VALUES ('" & iu & "'" & _
					  		", '" & dt_measured_new & "'" & _
							", '" & 4 & "'" & _
							", '" & 1 & "'" & _
							", '" & i_fk_measured_system_new & "'" & _
							", '" & lng_fk_cm_m01 & "'" & _
							", '" & lng_fk_cm_deci_m01 & "'" & _
							", '" & lng_fk_feet_m01 & "'" & _
							", '" & lng_fk_inch_m01 & "'" & _
							", '" & lng_fk_eighths_inch_m01 & "'" & _
							", '" & lng_fk_sixteenth_inch_m01 & "'" & _
							", '" & lng_fk_thirtysecond_inch_m01 & "'" & _
							", '" & lng_kg_01 & "'" & _
							", '" & 0 & "'" & _
							", '" & lng_fk_lbs_01 & "'" & _
							", '" & 1 & "'" & _
							", '" & lng_fk_User_ID_update & "'" & _
					 ")"

'					 Response.Write(sql_new & "<br>")
'					 Response.End()
'zuerst muss der max wert überprüft (consolidierte wert)
'erst wenn alles ok wird gespeichert
'					If Cint(i_insert_error) = 0 Then
'						objConn.Execute sql_new
'					end if

'messung #2	---------------------------------------------------------------	
			If i_fk_measured_system_new = 1 Then'metric
				lng_fk_cm_m02 = Request("LST_cm_m02")
				lng_fk_cm_deci_m02 = Request("LST_cm_deci_m02")
				
				dbl_measured_mm_athlete_02 = fc_get_metric_value(lng_fk_cm_m02)
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_cm_deci_m02))
				dbl_measured_mm_athlete_02 = dbl_measured_mm_athlete_02 * 10

				If lng_fk_cm_m02 > 0 or lng_fk_cm_m02 > 0 Then
					id_02 = 1
				else
					id_02 = 0
				end if

				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_feet_m02 = 0
				lng_fk_inch_m02 = 0
				lng_fk_eighths_inch_m02 = 0
				lng_fk_sixteenth_inch_m02 = 0
				lng_fk_thirtysecond_inch_m02 = 0
			end if

			If i_fk_measured_system_new = 2 Then'feet - inch -1/8
				lng_fk_feet_m02 = Request("LST_feet_08_m02")
				lng_fk_inch_m02 = Request("LST_inch_08_m02")
				lng_fk_eighths_inch_m02 = Request("LST_eighths_inch_m02")
				
				dbl_measured_mm_athlete_02 = fc_get_metric_value(lng_fk_feet_m02)
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_inch_m02))
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_eighths_inch_m02))
				
				If lng_fk_feet_m02 > 0 or lng_fk_inch_m02 > 0 or lng_fk_eighths_inch_m02 > 0 Then
					id_02 = 1
				else
					id_02 = 0
				end if

				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m02 = 0
				lng_fk_cm_deci_m02 = 0
				lng_fk_sixteenth_inch_m02 = 0
				lng_fk_thirtysecond_inch_m02 = 0
			end if
			
			If i_fk_measured_system_new = 3 Then'feet - inch -1/16
				lng_fk_feet_m02 = Request("LST_feet_16_m02")
				lng_fk_inch_m02 = Request("LST_inch_16_m02")
				lng_fk_sixteenth_inch_m02 = Request("LST_sixteenth_m02")
				
				dbl_measured_mm_athlete_02 = fc_get_metric_value(lng_fk_feet_m02)
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_inch_m02))
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_sixteenth_inch_m02))
				
				If lng_fk_feet_m02 > 0 or lng_fk_inch_m02 > 0 or lng_fk_sixteenth_inch_m02 > 0 Then
					id_02 = 1
				else
					id_02 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m02 = 0
				lng_fk_cm_deci_m02 = 0
				lng_fk_eighths_inch_m02 = 0
				lng_fk_thirtysecond_inch_m02 = 0
			end if

			
			If i_fk_measured_system_new = 4 Then'feet - inch -1/32
				lng_fk_feet_m02 = Request("LST_feet_32_m02")
				lng_fk_inch_m02 = Request("LST_inch_32_m02")
				lng_fk_thirtysecond_inch_m02 = Request("LST_thirtysecond_inch_m02")
				
				dbl_measured_mm_athlete_02 = fc_get_metric_value(lng_fk_feet_m02)
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_inch_m02))
				dbl_measured_mm_athlete_02 = (dbl_measured_mm_athlete_02 ) + (fc_get_metric_value(lng_fk_thirtysecond_inch_m02))
				
				If lng_fk_feet_m02 > 0 or lng_fk_inch_m02 > 0 or lng_fk_thirtysecond_inch_m02 > 0 Then
					id_02 = 1
				else
					id_02 = 0
				end if

				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m02 = 0
				lng_fk_cm_deci_m02 = 0
				lng_fk_eighths_inch_m02 = 0
				lng_fk_sixteenth_inch_m02 = 0
			end if

'überprüfung der eingabe (nur wenn dafür alle notwendigen dropdowns ausgewählt wurden)----------------------------------
'wenn eine eingabe fehlt werden alle au 0 gesetzt
			If i_fk_measured_system_new = 1 Then'metric
				'größe
				If lng_fk_cm_m02 = 0 or lng_fk_cm_deci_m02 = 0 Then
					lng_fk_cm_m02 = 0
					lng_fk_cm_deci_m02 = 0
					id_02 = 0' id_02 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	

			If i_fk_measured_system_new = 2 Then'feet - inch -1/8
				'größe
				If lng_fk_feet_m02 = 0 or lng_fk_inch_m02 = 0 or lng_fk_eighths_inch_m02 = 0 Then
					lng_fk_feet_m02 = 0
					lng_fk_inch_m02 = 0
					lng_fk_eighths_inch_m02 = 0
					id_02 = 0' id_02 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	
			
			If i_fk_measured_system_new = 3 Then'feet - inch -1/16
				'größe
				If lng_fk_feet_m02 = 0 or lng_fk_inch_m02 = 0 or lng_fk_sixteenth_inch_m02 = 0 Then
					lng_fk_feet_m02 = 0
					lng_fk_inch_m02 = 0
					lng_fk_sixteenth_inch_m02 = 0
					id_02 = 0' id_02 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	

			If i_fk_measured_system_new = 4 Then'feet - inch -1/32
				'größe
				If lng_fk_feet_m02 = 0 or lng_fk_inch_m02 = 0 or lng_fk_thirtysecond_inch_m02 = 0 Then
					lng_fk_feet_m02 = 0
					lng_fk_inch_m02 = 0
					lng_fk_thirtysecond_inch_m02 = 0
					id_02 = 0' id_02 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	
'--------------------------------------------------------------------------------------------------------------------
					sql_new_02 = "INSERT INTO tbl_0801_athlete_measured " & _
					 "(" & _
							" lng_fk_User_ID" & _
							", dt_measured" & _
							", i_fk_measured_type" & _
							", i_measured_series" & _
							", i_fk_measured_system" & _
							", lng_fk_cm" & _
							", lng_fk_cm_deci" & _
							", lng_fk_feet" & _
							", lng_fk_inch" & _
							", lng_fk_eighths_inch" & _
							", lng_fk_sixteenth_inch" & _
							", lng_fk_thirtysecond_inch" & _
							", lng_fk_kg" & _
							", lng_fk_kg_deci" & _
							", lng_fk_lbs" & _
							", i_fk_status" & _
							", lng_fk_User_ID_update" & _
					  ") VALUES ('" & iu & "'" & _
					  		", '" & dt_measured_new & "'" & _
							", '" & 4 & "'" & _
							", '" & 2 & "'" & _
							", '" & i_fk_measured_system_new & "'" & _
							", '" & lng_fk_cm_m02 & "'" & _
							", '" & lng_fk_cm_deci_m02 & "'" & _
							", '" & lng_fk_feet_m02 & "'" & _
							", '" & lng_fk_inch_m02 & "'" & _
							", '" & lng_fk_eighths_inch_m02 & "'" & _
							", '" & lng_fk_sixteenth_inch_m02 & "'" & _
							", '" & lng_fk_thirtysecond_inch_m02 & "'" & _
							", '" & lng_kg_01 & "'" & _
							", '" & 0 & "'" & _
							", '" & lng_fk_lbs_01 & "'" & _
							", '" & 1 & "'" & _
							", '" & lng_fk_User_ID_update & "'" & _
					 ")"
					 
'					 Response.Write("lng_fk_cm_m02: " & lng_fk_cm_m02 & "<br>")
'					 Response.Write("lng_fk_cm_deci_m02: " & lng_fk_cm_deci_m02 & "<br>")
'					 Response.Write("lng_fk_feet_m02: " & lng_fk_feet_m02 & "<br>")
'					 Response.Write("lng_fk_inch_m02: " & lng_fk_inch_m02 & "<br>")
'					 Response.Write("lng_fk_eighths_inch_m02: " & lng_fk_eighths_inch_m02 & "<br>")
'					 Response.Write("lng_fk_sixteenth_inch_m02: " & lng_fk_sixteenth_inch_m02 & "<br>")
'					 Response.Write("lng_fk_thirtysecond_inch_m02: " & lng_fk_thirtysecond_inch_m02 & "<br>")
'					 Response.Write("lng_kg_01: " & lng_kg_01 & "<br>")
'					 Response.Write("lng_fk_lbs_01: " & lng_fk_lbs_01 & "<br>")


'					 Response.Write(sql_new & "<br>")
'					 Response.End()
'zuerst muss der max wert überprüft (consolidierte wert)
'erst wenn alles ok wird gespeichert
'					 If Cint(i_insert_error) = 0 Then
'						objConn.Execute sql_new
'					end if

'messung #3	---------------------------------------------------------------	
			If i_fk_measured_system_new = 1 Then'metric
				lng_fk_cm_m03 = Request("LST_cm_m03")
				lng_fk_cm_deci_m03 = Request("LST_cm_deci_m03")
				
				dbl_measured_mm_athlete_03 = fc_get_metric_value(lng_fk_cm_m03)
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_cm_deci_m03))
				dbl_measured_mm_athlete_03 = dbl_measured_mm_athlete_03 * 10
				
				If lng_fk_cm_m03 > 0 or lng_fk_cm_m03 > 0 Then
					id_03 = 1
				else
					id_03 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_feet_m03 = 0
				lng_fk_inch_m03 = 0
				lng_fk_eighths_inch_m03 = 0
				lng_fk_sixteenth_inch_m03 = 0
				lng_fk_thirtysecond_inch_m03 = 0
			end if

			If i_fk_measured_system_new = 2 Then'feet - inch -1/8
				lng_fk_feet_m03 = Request("LST_feet_08_m03")
				lng_fk_inch_m03 = Request("LST_inch_08_m03")
				lng_fk_eighths_inch_m03 = Request("LST_eighths_inch_m03")
				
				dbl_measured_mm_athlete_03 = fc_get_metric_value(lng_fk_feet_m03)
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_inch_m03))
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_eighths_inch_m03))
				
				If lng_fk_feet_m03 > 0 or lng_fk_inch_m03 > 0 or lng_fk_eighths_inch_m03 > 0 Then
					id_03 = 1
				else
					id_03 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m03 = 0
				lng_fk_cm_deci_m03 = 0
				lng_fk_sixteenth_inch_m03 = 0
				lng_fk_thirtysecond_inch_m03 = 0
			end if
			
			If i_fk_measured_system_new = 3 Then'feet - inch -1/16
				lng_fk_feet_m03 = Request("LST_feet_16_m03")
				lng_fk_inch_m03 = Request("LST_inch_16_m03")
				lng_fk_sixteenth_inch_m03 = Request("LST_sixteenth_m03")
				
				dbl_measured_mm_athlete_03 = fc_get_metric_value(lng_fk_feet_m03)
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_inch_m03))
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_sixteenth_inch_m03))
				
				If lng_fk_feet_m03 > 0 or lng_fk_inch_m03 > 0 or lng_fk_sixteenth_inch_m03 > 0 Then
					id_03 = 1
				else
					id_03 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m03 = 0
				lng_fk_cm_deci_m03 = 0
				lng_fk_eighths_inch_m03 = 0
				lng_fk_thirtysecond_inch_m03 = 0
			end if
			
			If i_fk_measured_system_new = 4 Then'feet - inch -1/32
				lng_fk_feet_m03 = Request("LST_feet_32_m03")
				lng_fk_inch_m03 = Request("LST_inch_32_m03")
				lng_fk_thirtysecond_inch_m03 = Request("LST_thirtysecond_inch_m03")
				
				dbl_measured_mm_athlete_03 = fc_get_metric_value(lng_fk_feet_m03)
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_inch_m03))
				dbl_measured_mm_athlete_03 = (dbl_measured_mm_athlete_03 ) + (fc_get_metric_value(lng_fk_thirtysecond_inch_m03))
				
				If lng_fk_feet_m03 > 0 or lng_fk_inch_m03 > 0 or lng_fk_thirtysecond_inch_m03 > 0 Then
					id_03 = 1
				else
					id_03 = 0
				end if
				
				'20130103 die nicht verwendeten felder werden auf 0 gesetzt
				lng_fk_cm_m03 = 0
				lng_fk_cm_deci_m03 = 0
				lng_fk_eighths_inch_m03 = 0
				lng_fk_sixteenth_inch_m03 = 0
			end if

'überprüfung der eingabe (nur wenn dafür alle notwendigen dropdowns ausgewählt wurden)----------------------------------
'wenn eine eingabe fehlt werden alle au 0 gesetzt
			If i_fk_measured_system_new = 1 Then'metric
				'größe
				If lng_fk_cm_m03 = 0 or lng_fk_cm_deci_m03 = 0 Then
					lng_fk_cm_m03 = 0
					lng_fk_cm_deci_m03 = 0
					id_03 = 0' id_03 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	

			If i_fk_measured_system_new = 2 Then'feet - inch -1/8
				'größe
				If lng_fk_feet_m03 = 0 or lng_fk_inch_m03 = 0 or lng_fk_eighths_inch_m03 = 0 Then
					lng_fk_feet_m03 = 0
					lng_fk_inch_m03 = 0
					lng_fk_eighths_inch_m03 = 0
					id_03 = 0' id_03 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	
			
			If i_fk_measured_system_new = 3 Then'feet - inch -1/16
				'größe
				If lng_fk_feet_m03 = 0 or lng_fk_inch_m03 = 0 or lng_fk_sixteenth_inch_m03 = 0 Then
					lng_fk_feet_m03 = 0
					lng_fk_inch_m03 = 0
					lng_fk_sixteenth_inch_m03 = 0
					id_03 = 0' id_03 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	

			If i_fk_measured_system_new = 4 Then'feet - inch -1/32
				'größe
				If lng_fk_feet_m03 = 0 or lng_fk_inch_m03 = 0 or lng_fk_thirtysecond_inch_m03 = 0 Then
					lng_fk_feet_m03 = 0
					lng_fk_inch_m03 = 0
					lng_fk_thirtysecond_inch_m03 = 0
					id_03 = 0' id_03 ...  wurde eine auswahl im dropdown getätigt '0=keine auswahl 1=ok
				end if
			end if	
'--------------------------------------------------------------------------------------------------------------------
					sql_new_03 = "INSERT INTO tbl_0801_athlete_measured " & _
					 "(" & _
							" lng_fk_User_ID" & _
							", dt_measured" & _
							", i_fk_measured_type" & _
							", i_measured_series" & _
							", i_fk_measured_system" & _
							", lng_fk_cm" & _
							", lng_fk_cm_deci" & _
							", lng_fk_feet" & _
							", lng_fk_inch" & _
							", lng_fk_eighths_inch" & _
							", lng_fk_sixteenth_inch" & _
							", lng_fk_thirtysecond_inch" & _
							", lng_fk_kg" & _
							", lng_fk_kg_deci" & _
							", lng_fk_lbs" & _
							", i_fk_status" & _
							", lng_fk_User_ID_update" & _
					  ") VALUES ('" & iu & "'" & _
					  		", '" & dt_measured_new & "'" & _
							", '" & 4 & "'" & _
							", '" & 3 & "'" & _
							", '" & i_fk_measured_system_new & "'" & _
							", '" & lng_fk_cm_m03 & "'" & _
							", '" & lng_fk_cm_deci_m03 & "'" & _
							", '" & lng_fk_feet_m03 & "'" & _
							", '" & lng_fk_inch_m03 & "'" & _
							", '" & lng_fk_eighths_inch_m03 & "'" & _
							", '" & lng_fk_sixteenth_inch_m03 & "'" & _
							", '" & lng_fk_thirtysecond_inch_m03 & "'" & _
							", '" & lng_kg_01 & "'" & _
							", '" & 0 & "'" & _
							", '" & lng_fk_lbs_01 & "'" & _
							", '" & 1 & "'" & _
							", '" & lng_fk_User_ID_update & "'" & _
					 ")"

'					 Response.Write(sql_new & "<br>")
'					 Response.End()
'zuerst muss der max wert überprüft (consolidierte wert)
'erst wenn alles ok wird gespeichert
'					If Cint(i_insert_error) = 0 Then
'						objConn.Execute sql_new
'					end if
					 
					'******************************************************************************
					' gibt den durrchschnittswert zurück
					' InputParameter:
					' dbl_measured_mm_athlete_01 ... wert messung #1
					' dbl_measured_mm_athlete_02 ... wert messung #2
					' dbl_measured_mm_athlete_03 ... wert messung #3
					'******************************************************************************

'Response.Write("#1a: " & dbl_measured_mm_athlete_01 & "<br>")
'Response.Write("#2a: " & dbl_measured_mm_athlete_02 & "<br>")
'Response.Write("#3a: " & dbl_measured_mm_athlete_03 & "<br>")
					
					'derzeit noch in arbeit - möglich dass es in java gemacht wird
					'id_01 >>> '0=keine auswahl 1=ok
					dbl_measured_mm_athlete_average = fc_get_dbl_average_value(dbl_measured_mm_athlete_01, dbl_measured_mm_athlete_02, dbl_measured_mm_athlete_03, id_01, id_02, id_03)
					
					'fc_check_value_replace(str_replace_string, i_default_len)
					dbl_measured_mm_athlete_average = fc_check_value_replace_comma(dbl_measured_mm_athlete_average, 1)
					dbl_measured_kg = fc_check_value_replace_comma(dbl_measured_kg, 1)
					
					'der ausgabewert als string 
					'******************************************************************************
					' gibt den durchschnittswert als string zurück, zb. der abgespeicherte wert ist immer metric >> der angezeigte soll zb: 3'' 1' 10/32' sein
					' InputParameter:
					' dbl_measured_mm_athlete ... der metrische wert
					' i_fk_measured_system ... welches messsystem
					'******************************************************************************
					'Function fc_get_str_average_value(dbl_measured_mm_athlete_average, i_fk_measured_system)
					str_measured_mm_athlete_average = fc_get_str_average_value(dbl_measured_mm_athlete_average, i_fk_measured_system_new)
					If Len(str_measured_mm_athlete_average) = 0 Then
						str_measured_mm_athlete_average = 0
					end if

'--------------------------------------------------------------------------------------------------------
'holt jetzt die größte Messung <Consolidated Height>
Dim dbl_measured_mm_max
Dim dbl_toleranz
dbl_toleranz = Con_i_toleranz

'i_fk_measured_type
'1	Master Athlete
'2	Master Mother
'3	Master Father
'4	Calculate Athlete
'ohne erstgrößeneingabe
'SQL = "SELECT max(dbl_measured_mm) AS max FROM tbl_0802_athlete_calculated " & _
'"WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '4' AND dt_measured < '" & dt_measured_new & "'"

SQL = "SELECT max(dbl_measured_mm) AS max FROM tbl_0802_athlete_calculated " & _
"WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '4' " & _
"AND dt_measured < '" & dt_measured_new & "' " & _
"AND i_number_of_changes = '" & 0 & "'"

'Response.Write(SQL & "<br>")
'Response.End()

Set rst_tmp = Server.CreateObject("ADODB.Recordset")
rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   
    If Not rst_tmp.EOF Then
        dbl_measured_mm_max = rst_tmp.Fields("max").Value
    End if
	rst_tmp.Close
set rst_tmp = Nothing
'abzug der toleranz
dbl_measured_mm_max = dbl_measured_mm_max - dbl_toleranz

'Response.Write("#1 dbl_measured_mm_athlete_average: " & dbl_measured_mm_athlete_average & "<br>")
'Response.Write("#1 dbl_measured_mm_max: " & dbl_measured_mm_max & "<br>")
'--------------------------------------------------------------------------------------------------------
'überprüfung ob der athlete geschrumpft ist - inkl toleranz <Con_i_toleranz> mm
'Const Con_Msg_27e = "Das eingegebene Meesung ist zu klein!"'man kann nicht schrumpfen
'Const Con_Msg_27f = "Das eingegebene Meesung ist zu klein! Wenn eine Messung in der Vergangenheit größer als eine in der Zukunft."'man kann nicht schrumpfen
If Len(dbl_measured_mm_athlete_average) > 0 Then
	dbl_measured_mm_athlete_average = CDbl(dbl_measured_mm_athlete_average)
end if
If Len(dbl_measured_mm_max) > 0 Then
	dbl_measured_mm_max =  CDbl(dbl_measured_mm_max)
end if

'Response.Write(dbl_measured_mm_athlete_average & "<br>")
If dbl_measured_mm_athlete_average < dbl_measured_mm_max Then
	'Response.Write("Error #1 & <br>")
'20120318
'Änderung neues Feld wenn eine Messung kleiner wird
'das bestehende Feld für Passiv <i_number_of_changes> ist nur mehr für Andrey
'wenn ein Athlete eine Messung als Passiv setzt wird nurmehr dieses Feld verwendet
'wenn die Messung als zu klein eingestuft wird dann wird nurmehr das alte feld <i_number_of_changes> verwendet

'deak
'str_insert_error_msg = str_insert_error_msg & "-" & Con_Msg_27e  & "<br>"
'i_insert_error = 1
	
	'neu für Andrey muss es aber trotzdem auf passive gesetzt werden
	i_systempassiv = 1'1=die daten werden für Andrey auf pasiv gesetzt/Default = 0
end if

'--------------------------------------------------------------------------------------------------------
'eingabe in der vergangenheit aber der wert ist > als einer der vom datum her später eingegeben wurde
'gibt den wert zurück der nicht überschritten werden darf
Dim dbl_measured_mm_min_date'der wert

'i_fk_measured_type
'1	Master Athlete
'2	Master Mother
'3	Master Father
'4	Calculate Athlete

'ohne erstgrößeneingabe
'SQL = "SELECT min(dbl_measured_mm) AS max FROM tbl_0802_athlete_calculated " & _
'"WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '4' AND dt_measured > '" & dt_measured_new & "'"

SQL = "SELECT min(dbl_measured_mm) AS max FROM tbl_0802_athlete_calculated " & _
"WHERE lng_fk_User_ID = '" & iu & "' " & _
"AND i_fk_measured_type = '4' " & _
"AND dt_measured > '" & dt_measured_new & "' " & _
"AND i_number_of_changes = '" & 0 & "'"

'Response.Write(SQL & "<br>")
'Response.End()

Set rst_tmp = Server.CreateObject("ADODB.Recordset")
rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   
    If Not rst_tmp.EOF Then
        dbl_measured_mm_min_date = rst_tmp.Fields("max").Value
    End if
	rst_tmp.Close
set rst_tmp = Nothing
'abzug der toleranz
dbl_measured_mm_min_date = dbl_measured_mm_min_date - dbl_toleranz
'Response.Write("#1 dbl_measured_mm_min_date: " & dbl_measured_mm_min_date & "<br>")
'Response.Write("dbl_measured_mm_athlete_average: " & dbl_measured_mm_athlete_average & "<br>")

If Len(dbl_measured_mm_athlete_average) > 0 Then
	dbl_measured_mm_athlete_average = CDbl(dbl_measured_mm_athlete_average)
end if
If Len(dbl_measured_mm_min_date) > 0 Then
	dbl_measured_mm_min_date =  CDbl(dbl_measured_mm_min_date)
end if

				If dt_now > dt_measured_new and dt_measured_new > dt_dat_min_back_default and dbl_measured_mm_athlete_average > dbl_measured_mm_min_date Then
					
'					Response.Write("Error #2 <br>")
'					Response.Write("dt_now: " & dt_now & "<br>")
'					Response.Write("dt_measured_new: " & dt_measured_new & "<br>")
'					Response.Write("dt_dat_min_back_default: " & dt_dat_min_back_default & "<br>")
'					Response.Write("dbl_measured_mm_athlete_average: " & dbl_measured_mm_athlete_average & "<br>")
'					Response.Write("dbl_measured_mm_min_date: " & dbl_measured_mm_min_date & "<br>")
					
					str_insert_error_msg = str_insert_error_msg & "-" & str_Con_Msg_27f  & "<br>"
					i_insert_error = 1
				end if

				'nur ein hinweis der BMI ist zu gross oder zu klein
				If i_bmi < Con_i_bmi_min and i_bmi > 0 or i_bmi < Con_i_bmi_max and i_bmi > 0 Then
					i_bmi_error = i_bmi_error + 1
					'i_insert_error = 1
				else
					i_bmi_error = 0 'default
				end if
					
					sql_new = "INSERT INTO tbl_0802_athlete_calculated " & _
					 "(" & _
							" lng_fk_User_ID" & _
							", dt_measured" & _
							", i_fk_measured_type" & _
							", dbl_measured_mm" & _
							", dbl_measured_kg" & _
							", lng_fk_User_ID_update" & _
					  ") VALUES ('" & iu & "'" & _
							", '" & dt_measured_new & "'" & _
							", '" & 4 & "'" & _
							", '" & dbl_measured_mm_athlete_average & "'" & _
							", '" & dbl_measured_kg & "'" & _
							", '" & lng_fk_User_ID_update & "'" & _
					 ")"
					 

'					 Response.Write(sql_new & "<br>")
'					 Response.End()
					 If Cint(i_insert_error) = 0 Then
					 
						objConn.Execute sql_new_01
						objConn.Execute sql_new_02
						objConn.Execute sql_new_03
						objConn.Execute sql_new

'Response.Write(sql_new_01 & "<br>")
'Response.Write(sql_new_02 & "<br>")
'Response.Write(sql_new_03 & "<br>")
'Response.Write(sql_new & "<br>")
'Response.End()
						
						'20120318
						'fall die Messung kleiner ist als eine schon erfasste muss nachträglich die Tabelle (tbl_0801_athlete_measured) 
						'mit dieser Eingabe aktualisiert werden
						If i_systempassiv = 1 Then
						
							'setzt diese größeneingabe auf passiv
							'iu >> die user id
							'ID_dt_measured >> das datum der größeneingabe
							'dt_retcon_date >> das datum der änderung
							'Call sb_to_retcon(iu, ID_dt_measured, dt_retcon_date)
							'dt_date_calculation >>> datumsformat für Andrey
							'i_passiv >> 0 = passiv wird vom user ausgelöst / 1 = passiv wird vom system ausgelöst und die daten bleiben sichtbar nur für andrey nicht verwendbar
							'auch beim passiv setzten soll die trainer (falls es der trainer) ist eingetragen werden
							'inkl 
							'Call sb_to_retcon(iu, ID_dt_measured, dt_retcon_date, lng_fk_User_ID_update, dt_date_calculation, 0)
							
							dt_retcon_date =  fc_str_date_server_format(Now(), 3)
							dt_date_calculation =  fc_str_date_server_format(dt_measured_new,3)
			
							Call sb_to_retcon(iu, dt_measured_new, dt_retcon_date, lng_fk_User_ID_update, dt_date_calculation, 1)
					 
					 	end if

						
'						Response.Write("sql_new_01: " & sql_new_01 & "<br>")
'						Response.Write("sql_new_02: " & sql_new_02 & "<br>")
						'response.end()
'						Response.Write("sql_new_03: " & sql_new_03 & "<br>")
'						Response.Write("sql_new: " & sql_new & "<br>")

'#5 SP von Andrey (20110523)----------------------------------------------------------------------------------------
						'Function =
						'  UPDATE acc_calculation
						'     SET ca_calc_status = 'Invalid'
						'       , ca_invalidate_date = NOW()
						'   WHERE ac_id = p_user_id
						'     AND mt_type = 1 /* measurement_type = height */
						'     AND ca_calc_date >= p_date_from;
						
						'personId is the value of lng_k_User_ID field from tbl_0501_user table
						'fromDate is the date in DD-MM-YYYY format
						
						'beispiel
						'CALL INVALIDATE_CALCULATIONS(15, '16-04-2011')
						
						'sql_retcon = "CALL xINVALIDATE_CALCULATIONS(" & iu & ", '" & dt_date_calculation & "')"
						sql_retcon = "CALL INVALIDATE_ALL_CALCULATIONS(" & iu & ", '" & dt_measured_new & "')"
						
						'Response.Write("CALL INVALIDATE_ALL_CALCULATIONS: " & sql_retcon & "<br>")
						'Response.End()
						
						'objConn.Execute sql_new
'--------------------------------------------------------------------------------------------------------
						'BMI Überprüfung
						'berechnet den BMI Wert
						'Function fc_get_bmi_value(dbl_gewicht, dbl_groesse)
						Dim i_bmi_error
						Dim i_bmi 
						
						If Len(dbl_measured_kg) > 0 Then
							dbl_measured_kg = CDbl(dbl_measured_kg)
						end if
						If Len(dbl_measured_mm_athlete_average) > 0 Then
							dbl_measured_mm_athlete_average =  CDbl(dbl_measured_mm_athlete_average)
						end if
						
						If dbl_measured_kg > 0 and dbl_measured_mm_athlete_average >0 Then
							i_bmi = fc_get_bmi_value(dbl_measured_kg, dbl_measured_mm_athlete_average)
						end if
						'Response.Write("i_bmi: " & i_bmi & "<br>")
'--------------------------------------------------------------------------------------------------------						
					end if


			If Cint(i_insert_error) > 0 Then
				'call showMessage(str_Con_Msg_29)
			end if'If Cint(i_insert_error) > 0 Then



end if'If trancd = "S" Then'speichert den neuen datensatz
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Ende Andrey Info 02 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 04 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

	If trancd = "P" Then'setzt den ausgewählten datensatz auf passiv
	
		i_dyna_counter = 0
		
		For i_zaehler = 1 to i_dyna_pro_seite'=zb 20
			
			'dyn. namensgebung
			i_dyna_counter = i_dyna_counter + 1
			ID_dt_measured_x = "ID_dt_measured_" & i_dyna_counter
			ckk_i_passive_x = "ckk_i_passive_" & i_dyna_counter

			'value....
			ID_dt_measured = Request(ID_dt_measured_x)
			i_passive = Request(ckk_i_passive_x)
			
			'Response.Write(ckk_i_passive_x & "<br>")
			
			'wenn die checkbox aktiviert ist ....
			If i_passive = "checkbox" Then
				i_passive = 1
			else
				i_passive = 0	
			end if
			If IsNull(i_passive) or IsNull(i_passive) or Len(i_passive) = 0 Then
				i_passive = 0
			end if
	
			If Cint(i_passive) > 0 Then
				'Response.Write("ID_dt_measured: " & ID_dt_measured & "<br>")
				dt_retcon_date =  fc_str_date_server_format(Now(), 3)
				dt_date_calculation =  fc_str_date_server_format(ID_dt_measured,3)
				
'setzt diese größeneingabe auf passiv
'iu >> die user id
'ID_dt_measured >> das datum der größeneingabe
'dt_retcon_date >> das datum der änderung
'Call sb_to_retcon(iu, ID_dt_measured, dt_retcon_date)
'dt_date_calculation >>> datumsformat für Andrey
'i_passiv >> 0 = passiv wird vom user ausgelöst / 1 = passiv wird vom system ausgelöst und die daten bleiben sichtbar nur für andrey nicht verwendbar
'auch beim passiv setzten soll die trainer (falls es der trainer) ist eingetragen werden
'inkl 
Call sb_to_retcon(iu, ID_dt_measured, dt_retcon_date, lng_fk_User_ID_update, dt_date_calculation, 0)


					
			end if
		
		Next

	end if'If trancd = "P" Then'setzt den ausgewählten datensatz auf passiv

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Ende Andrey Info 04 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 05 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
	If trancd = "L" Then'ladet die seite neu
		dt_measured_new = Now()

'Response.Write("#0 dt_measured_new: " & dt_measured_new & "<br>")
'response.End()
	
		dt_measured_new = fc_str_date_Server_format(dt_measured_new, 3)
'Response.Write("#0 dt_measured_new: " & dt_measured_new & "<br>")

		If IsNull(dt_measured_new) or IsEmpty(dt_measured_new) Then
			dt_measured_new = fc_str_date_server_format(Now(), 3)
			'Response.Write("#1 dt_measured_new: " & dt_measured_new & "<br>")
		end if
	
	'Response.Write("#2 dt_measured_new: " & dt_measured_new & "<br>")
	
		i_day = Day(dt_measured_new)
			'Response.Write("i_day: " & i_day & "<br>")
		i_month	= Month(dt_measured_new)
			'Response.Write("i_month: " & i_month & "<br>")
		i_year = Year(dt_measured_new)
			'Response.Write("i_year: " & i_year & "<br>")
	
	end if
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ End Andrey Info 05 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 06 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'die letzte messung wird voreingestellt ---------------------------------------------------------------------------------------------------------
'If 1 > 2 Then
		sql_tmp = "SELECT Max(dt_measured) as max FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID =" & iu & " GROUP BY lng_fk_User_ID"
'Response.Write(sql_tmp)
'Response.End()

		Set rst_tmp = Server.CreateObject("ADODB.Recordset")
    	rst_tmp.Open sql_tmp, objConn, adOpenStatic, adLockReadOnly   
        	If Not rst_tmp.EOF Then	
				dt_measured_last = rst_tmp.Fields("max")
			end if
	    rst_tmp.Close
		Set rst_tmp = Nothing
		
		If Isdate(dt_measured_last) Then
			dt_measured_last = fc_str_date_server_format(dt_measured_last, 3)'serverformat
		end if

'Response.Write(dt_measured_last & "<br>")

'i_fk_measured_type
'1	Master Athlete
'2	Master Mother
'3	Master Father
'4	Calculate Athlete

'i_fk_measured_system
'0	+++please select+++	1
'1	metric				2
'2	feet - inch -1/8	3
'3	feet - inch -1/16	4
'4	feet - inch -1/32	5

'i_fk_measured_type
'1	Master Athlete
'2	Master Mother
'3	Master Father
'4	Calculate Athlete

'Messreihe #1
'liest die letzte messung ein-----------------------------------------------------------------------------
	'muss noch überprüft werden welches sql dass richtige ist
	'sql_tmp = "SELECT Max(dt_measured) as max FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & "'"

'		sql_tmp = "SELECT lng_fk_cm, lng_fk_kg, lng_fk_lbs FROM tbl_0801_athlete_measured " & _
'		"WHERE lng_fk_User_ID = '" & iu & "' AND dt_measured = '" & dt_measured_last  & "' " & _
'		"AND i_measured_series = '" & 1 & "' AND i_fk_measured_type = '" & 4 & "'"

'berücksichtigt nur aktive datensätze
		sql_tmp = "SELECT lng_fk_cm, lng_fk_kg, lng_fk_lbs FROM tbl_0801_athlete_measured " & _
		"WHERE lng_fk_User_ID = '" & iu & "' AND dt_measured = '" & dt_measured_last  & "' " & _
		"AND i_measured_series = '" & 1 & "' AND i_fk_measured_type = '" & 4 & "' " & _
		"AND i_number_of_changes = '" & 0 & "'"
		
		Set rst_tmp = Server.CreateObject("ADODB.Recordset")
    	rst_tmp.Open sql_tmp, objConn, adOpenStatic, adLockReadOnly  
			If Not rst_tmp.EOF Then	 
'        i_fk_measured_system_new = rst_tmp.Fields("i_fk_measured_system")'ob metric oder feet ...
				lng_fk_cm_m01_last = rst_tmp.Fields("lng_fk_cm")
'				lng_fk_cm_deci_m01_last = rst_tmp.Fields("lng_fk_cm_deci")
'				lng_fk_feet_m01_last = rst_tmp.Fields("lng_fk_feet")
'				lng_fk_inch_m01_last = rst_tmp.Fields("lng_fk_inch")
'				lng_fk_eighths_inch_m01_last = rst_tmp.Fields("lng_fk_eighths_inch")
'				lng_fk_sixteenth_inch_m01_last = rst_tmp.Fields("lng_fk_sixteenth_inch")
'				lng_fk_thirtysecond_inch_m01_last = rst_tmp.Fields("lng_fk_thirtysecond_inch")
				lng_kg_01_last = rst_tmp.Fields("lng_fk_kg")
				lng_fk_lbs_01_last = rst_tmp.Fields("lng_fk_lbs")
			end if
	    rst_tmp.Close
		Set rst_tmp = Nothing

'Messreihe #2
'		sql_tmp = "SELECT lng_fk_cm FROM tbl_0801_athlete_measured " & _
'		"WHERE lng_fk_User_ID = '" & iu & "' AND dt_measured = '" & dt_measured_last & "' " & _
'		"AND i_measured_series = '" & 2 & "' AND i_fk_measured_type = '" & 4 & "'"

'berücksichtigt nur aktive datensätze
		sql_tmp = "SELECT lng_fk_cm FROM tbl_0801_athlete_measured " & _
		"WHERE lng_fk_User_ID = '" & iu & "' AND dt_measured = '" & dt_measured_last & "' " & _
		"AND i_measured_series = '" & 2 & "' AND i_fk_measured_type = '" & 4 & "' " & _
		"AND i_number_of_changes = '" & 0 & "'"
		
		Set rst_tmp = Server.CreateObject("ADODB.Recordset")
    	rst_tmp.Open sql_tmp, objConn, adOpenStatic, adLockReadOnly  
			If Not rst_tmp.EOF Then	 
				lng_fk_cm_m02_last = rst_tmp.Fields("lng_fk_cm")
'				lng_fk_cm_deci_m02_last = rst_tmp.Fields("lng_fk_cm_deci")
'				lng_fk_feet_m02_last = rst_tmp.Fields("lng_fk_feet")
'				lng_fk_inch_m02_last = rst_tmp.Fields("lng_fk_inch")
'				lng_fk_eighths_inch_m02_last = rst_tmp.Fields("lng_fk_eighths_inch")
'				lng_fk_sixteenth_inch_m02_last = rst_tmp.Fields("lng_fk_sixteenth_inch")
'				lng_fk_thirtysecond_inch_m02_last = rst_tmp.Fields("lng_fk_thirtysecond_inch")
			end if
	    rst_tmp.Close
		Set rst_tmp = Nothing

		'Response.Write(sql_tmp & "<br>")
'Messreihe #3
'		sql_tmp = "SELECT lng_fk_cm FROM tbl_0801_athlete_measured " & _
'		"WHERE lng_fk_User_ID = '" & iu & "' AND dt_measured = '" & dt_measured_last & "' " & _
'		"AND i_measured_series = '" & 3 & "' AND i_fk_measured_type = '" & 4 & "'"

'berücksichtigt nur aktive datensätze
		sql_tmp = "SELECT lng_fk_cm FROM tbl_0801_athlete_measured " & _
		"WHERE lng_fk_User_ID = '" & iu & "' AND dt_measured = '" & dt_measured_last & "' " & _
		"AND i_measured_series = '" & 3 & "' AND i_fk_measured_type = ' " & 4 & "'" & _
		"AND i_number_of_changes = '" & 0 & "'"
		
		Set rst_tmp = Server.CreateObject("ADODB.Recordset")
    	rst_tmp.Open sql_tmp, objConn, adOpenStatic, adLockReadOnly  
			If Not rst_tmp.EOF Then	 
				lng_fk_cm_m03_last = rst_tmp.Fields("lng_fk_cm")
'				lng_fk_cm_deci_m03_last = rst_tmp.Fields("lng_fk_cm_deci")
'				lng_fk_feet_m03_last = rst_tmp.Fields("lng_fk_feet")
'				lng_fk_inch_m03_last = rst_tmp.Fields("lng_fk_inch")
'				lng_fk_eighths_inch_m03_last = rst_tmp.Fields("lng_fk_eighths_inch")
'				lng_fk_sixteenth_inch_m03_last = rst_tmp.Fields("lng_fk_sixteenth_inch")
'				lng_fk_thirtysecond_inch_m03_last = rst_tmp.Fields("lng_fk_thirtysecond_inch")
			end if
	    rst_tmp.Close
		Set rst_tmp = Nothing
		
'Response.Write("i_fk_measured_system_01_last: " & i_fk_measured_system_new & "<br>")	 
'------------------------------------------------------------------------------------------------------------------------------------------------

	If IsDate(dt_measured_new) Then
		dt_measured_new = fc_str_date_server_format(dt_measured_new, 3)'ausgabeformat
	end if

'end if'If 1 > 2 Then
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ End Andrey Info 06 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

%>
<td width="900" align="left" class="navi">
	<table border="0" cellpadding="0" cellspacing="0" width="900">
		<td>
			<%
				'include menu object
				CALL userMenuWriteMenuObj("userMenu")
				CALL userMenuWriteInitScript("userMenu", objConn, getGroupByUser(objConn, iu), Session("ses_i_language"))
			%>    		
		</td>
		<td align="right">
			<div style="padding-right: 5px; ">
			<% CALL userMenuInsertPagePath2(objConn, getGroupByUser(objConn, iu), Session("ses_i_language"), "athlete_measured_data.asp", "", " : " & fc_get_username_voll(iu)) %>			
		    </div>
		</td>
	</table>  
</td>
        <!-- InstanceEndEditable -->
<td width="25">&nbsp;</td>
</tr>
<tr>
<td width="25">&nbsp;</td><!-- InstanceBeginEditable name="Edit_Content" -->
        <td width="900" height="450" align="left" valign="top" class="<%= defContAreaClass%>" id="contAreaBgEl"><table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" height="89">&nbsp;</td>
<td width="675" height="89" align="left" valign="bottom" style="padding-left: 0px;"><div id="a_tabbar" style="width:530px; height:21px; padding-bottom: 29px;"/></td>
<td width="25" height="89">&nbsp;</td>
</tr>
<tr>
<td width="200" height="340" align="left" valign="top">
<!--Left-side areas for each tab-->
<div id="tabbar-page-lhs-text-a1" style="display: none; ">
	<div class="txtbasesm">
		<br /><br />
		<%= fc_value_string(Session("ses_i_language"), "var_meas_at_05") %>
	</div>
	<br />
	<div class="txtbasesm">
		<span class="Stil8"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_06") %></span>
		<br /><br /><br />
	</div>
    <table style="margin-top: 65px;" width="195" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td width="44"><img src="images/ico/about24.png" width="24" height="24" hspace="10" /></td>
			<td width="4" class="txtsm11">&nbsp;</td>
			<td width="137" class="txtsm11">
                <div align="right"><a href="download/GrowmetryRatgeber01.pdf" target="_blank">
                    <img src="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_07") %>" width="103" height="22" border="0" title="<%= fc_value_string(Session("ses_i_language"), "var_hints_36") %>" alt="<%= fc_value_string(Session("ses_i_language"), "var_hints_36") %>"/></a>
                    <div style="margin-top: 9px;">
                        <a href="download/GrowmetryRatgeber01.pdf" target="_blank">       <%= fc_value_string(Session("ses_i_language"), "var_meas_at_08") %></a>
                    </div>
                </div>
            </td>
			<td width="10" class="txtsm11">&nbsp;</td>
		</tr>
	</table>
    <div style="margin-top: 150px; margin-left: 30px; height: 100px; width: 100px; background-image: url('/App/images/standard/fog_ath_meas_tab1_b.jpg')"></div>
</div>
<div id="tabbar-page-lhs-text-a2" style="display: none; ">
	<div class="txtbasesm">
		<br /><br />
		<%= fc_value_string(Session("ses_i_language"), "var_meas_at_56") %>
	</div>
    <div style="margin-top: 150px; margin-left: 30px; height: 100px; width: 100px; background-image: url('/App/images/standard/fog_ath_meas_tab1_b.jpg')"></div>
</div>
<div id="tabbar-page-lhs-text-a3" style="display: none; ">
	<div class="txtbasesm">
		<br /><br />
		<%= fc_value_string(Session("ses_i_language"), "var_meas_at_57") %>
	</div>
    <% if show_auth then %>
    <div class="txtbasesm" style="margin-top: 150px;">
		<%= fc_value_string(Session("ses_i_language"), "var_meas_at_58") %>
	</div>
    <% end if %>
    <div style="margin-top: 150px; margin-left: 30px; height: 100px; width: 100px; background-image: url('/App/images/standard/fog_ath_meas_tab1_b.jpg')"></div>
</div>
<!--End of left-side areas-->
<p class="txtbasesm">&nbsp; </p></td>
<td width="675" height="360" align="left" valign="top"><table width="675" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200">&nbsp;</td>
<td width="475" valign="top">

<!--First tab-->
<div id="page-enclosure-a1" style="display: none;">
<form method="Post" action="athlete_measured_data.asp?active_tab=a1&AP=<%=AP%>" onSubmit="return Form_inputcheck(this)" name="frm_value">
<table width="650" border="0" cellspacing="4" cellpadding="0">
<tr>
<td width="24" align="center" valign="bottom">&nbsp;</td>
<td valign="top">
<img src="images/ico/chart_pie16_nac.png" id="bg-calc-ani" alt="" title="" width="16" height="16" vspace="2" border="0" style="display: none; "/>
<table width="450" border="0" cellspacing="0" cellpadding="0">   
    <tr style="display: none;">
    <td width="45" height="25" class="txtform">&nbsp;</td>
    <td height="25" colspan="3">
    <input name="i_fk_measured_type_default" type="hidden" id="i_fk_measured_type_default" value="<%= i_fk_measured_type_default %>" size="6" maxlength="6" />
    <input name="i_fk_date_format" type="hidden" class="fielddata" id="i_fk_date_format" value="<%=i_fk_date_format%>" size="4" maxlength="4" />
    <input name="i_fk_measured_sytem" type="hidden" class="fielddata" id="i_fk_measured_sytem" dt_birthday size="4" maxlength="4" />
    <input name="dt_measured_new" type="hidden" class="fielddata" id="dt_measured_new" size="12" maxlength="12" />
    <span class="txttable">
    <input name="dt_birthday" type="hidden" class="fielddata" id="dt_birthday" value="<%=dt_birthday_js%>" size="12" maxlength="12" />
    <input name="btnSub" type="hidden" id="btnSub" value="<%=trancd%>" size="6" maxlength="6" />
    <input name="i_insert_error" type="hidden" id="i_insert_error" value="<%=i_insert_error%>" size="6" maxlength="6" />
    <input name="i_bmi" type="hidden" id="i_bmi" value="<%=i_bmi%>" size="6" maxlength="6" />
    <span class="txttablelist">
    <input name="iua" type="hidden" id="iua" value="<%=iua%>" size="6" maxlength="6" />
    <input name="iut" type="hidden" id="iut" value="<%=iut%>" size="6" maxlength="6" />
    <input name="iun" type="hidden" id="iun" value="<%=iun%>" size="6" maxlength="6" />
    </span></span></td>
  </tr>
  <tr>
    <td height="40" colspan="4" valign="bottom" class="txttable">
        <img src="images/ico/calendar32.png" width="32" height="32" hspace="5" border="0" />
        <strong><%= fc_value_string(Session("ses_i_language"), "var_meas_at_09") %></strong>  <%= fc_value_string(Session("ses_i_language"), "var_meas_at_14") %>
        <img style="margin: 0px 3px 0px 0px; float: right; top: 15px; position: relative;" src="images/ico/help16.png" alt="" width="16" height="16" hspace="10" class="help" onmouseover="Tip('<%= hint_127 %>', TITLE, '&lt;div class=\'TitleCls\'&gt;<%= hint_title_127 %>&lt;/div&gt;')" onmouseout="UnTip()" />
    </td>
  </tr>

<tr>
<td colspan="4" valign="bottom">&nbsp;</td>
</tr>
      
<% If 1 > 2 Then %>
<tr>
<td height="33" class="txtform">&nbsp;</td>
<td height="35" colspan="3" class="txtform"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_15") %> <%= i_month_back_user_info %> <%= fc_value_string(Session("ses_i_language"), "var_meas_at_16") %></td>
</tr>
 <% end if %>   
    
  <tr>
    <td width="45" height="25" class="txtform">&nbsp;</td>
    <td colspan="3" align="left">
    <% If i_fk_date_format = 1 Then %>
    <table border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
        <td width="50" class="txtblock11"><div align="left"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_29") %></div></td>
        <td width="50" class="txtblock11"><div align="left"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_30") %></div></td>
        <td class="txtblock11"><div align="left"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_31") %></div></td>
        </tr>
      <tr>
        <td width="50"><div align="left">
            <select name="LST_day_01" class="fieldmeasdate" id="LST_day_01" style="width:45px" onchange="javascript: refresh_birthday()">
              <% For i_zaehler_date = 1 to 31 %>
              <option <%If i_zaehler_date = Cint(i_day) Then%>selected<%end if%> value="<%=i_zaehler_date%>"><%=i_zaehler_date%></option>
              <% Next %>
            </select>
        </div></td>
        <td width="50"><div align="left">
            <select name="LST_month_01"  class="fieldmeasdate" id="LST_month_01" style="width:45px" onchange="javascript: refresh_birthday()">
              <% For i_zaehler_date = 1 to 12 %>
              <option <%If i_zaehler_date = Cint(i_month) Then%>selected<%end if%> value="<%=i_zaehler_date%>"><%=i_zaehler_date%></option>
              <% Next %>
            </select>
        </div></td>
        <td><div align="left">
            <select name="LST_year_01" class="fieldmeasdate" id="LST_year_01" style="width:60px" onchange="javascript: refresh_birthday()">
              <% For i_zaehler_date = Year(Now()) to i_year_back Step -1%>
              <option <%If i_zaehler_date = Cint(i_year) Then%>selected<%end if%> value="<%=i_zaehler_date%>"><%=i_zaehler_date%></option>
              <% Next %>
            </select>
        </div></td>
        </tr>
    </table>
	<% end if %>
    <% If i_fk_date_format = 2 Then %>
    <table border="0" align="left" cellpadding="0" cellspacing="0">
        <td width="50" class="txtblock11"><div align="left"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_30") %></div></td>
        <td width="50" class="txtblock11"><div align="left"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_29") %></div></td>
        <td class="txtblock11"><div align="left"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_31") %></div></td>
        </tr>
      <tr>
        <td width="50"><div align="left">
            <select name="LST_month_02"  class="fieldmeasdate" id="LST_month_02" style="width:45px" onchange="javascript: refresh_birthday()">
              <% For i_zaehler_date = 1 to 12 %>
              <option <%If i_zaehler_date = Cint(i_month) Then%>selected<%end if%> value="<%=i_zaehler_date%>"><%=i_zaehler_date%></option>
              <% Next %>
            </select>
        </div></td>
        <td width="50"><div align="left">
            <select name="LST_day_02" class="fieldmeasdate" id="LST_day_02" style="width:45px" onchange="javascript: refresh_birthday()">
              <% For i_zaehler_date = 1 to 31 %>
              <option <%If i_zaehler_date = Cint(i_day) Then%>selected<%end if%> value="<%=i_zaehler_date%>"><%=i_zaehler_date%></option>
              <% Next %>
            </select>
        </div></td>
        <td><div align="left">
            <select name="LST_year_02" class="fieldmeasdate" id="LST_year_02" style="width:60px" onchange="javascript: refresh_birthday()">
              <% For i_zaehler_date = Year(Now()) to i_year_back Step -1 %>
              <option <%If i_zaehler_date = Cint(i_year) Then%>selected<%end if%> value="<%=i_zaehler_date%>"><%=i_zaehler_date%></option>
            <% Next %>
            </select>
        </div></td>
        </tr>
    </table>
    <% end if %>    </td>
    </tr>

<tr>
<td height="33" class="txtform">&nbsp;</td>
<td height="35" colspan="3" class="txtform"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_15") %> <%= i_month_back_user_info %> <%= fc_value_string(Session("ses_i_language"), "var_meas_at_16") %></td>
</tr>
    
    
  <tr>
<td height="60" colspan="4" valign="bottom" class="txttable">
    <strong><img src="images/ico/tape_measure32.png" width="32" height="32" hspace="5" border="0" />
        <%= fc_value_string(Session("ses_i_language"), "var_meas_at_10") %></strong> <%= fc_value_string(Session("ses_i_language"), "var_meas_at_12") %>
        <img style="margin: 0px 3px 0px 0px; float: right; top: 15px; position: relative;" src="images/ico/help16.png" alt="" width="16" height="16" hspace="10" class="help" onMouseOver="Tip('<%= hint_129 %>', TITLE, '<div class=\'TitleCls\'><%= hint_title_129 %></div>')" onMouseOut="UnTip()" />
</td>
</tr>
  <tr>
    <td colspan="4" valign="bottom">&nbsp;</td>
  </tr>
<%           
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
'Messung 01 -----------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
%>
<tr id="tab_cm_m01" style="display: none">
<td width="45" height="25" align="center" class="txtform">#1</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_cm_m01" size="1" class="fieldmeasured" id="LST_cm_m01" style="" >
<%
'berechnet den Bereich der angezeigt werden soll 
'******************************************************************************
'fc_LST_range
'berechnet den bereich der im dropdown angezeigt werden soll
'i_value_last ... der letzte werte der einegeben wurde - um diesen Wert wird die matrix berechnet
'i_select_min ... der erste mögliche index im dropdown
'i_minus_value ... um wieviel der kleinste wert kleiner als der letzte wert sein soll
'i_select_max ... der letzte mögliche index im dropdown
'i_max_value ... um wieviel der größte wert größer als der letzte wert sein soll
'ix ... 1 >> berechnt den min - 2 >> berechnet den max
'Function fc_i_LST_range(i_value_last, i_select_min, i_minus_value, i_select_max, i_max_value, ix)
'i_range_min = fc_i_LST_range(lng_fk_cm_m01_last, 84, 5, 234, 10, 1)
'i_range_max = fc_i_LST_range(lng_fk_cm_m01_last, 84, 5, 234, 10, 2)
'Response.Write("lng_fk_cm_m01_last: " & lng_fk_cm_m01_last & "<br>")
'Response.Write("# i_range_min: " & i_range_min & "<br>")
'Response.Write("# i_range_max: " & i_range_max & "<br>")

'DropDown <>----------------------------------------------------------------------------------
'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 8 Order by dbl_value_x"

'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
'"WHERE i_fk_measurement_group = '8' " & _
'"AND lng_k_measurement >= '" & i_range_min & "'" & _
'"AND lng_k_measurement <= '" & i_range_max & "'" & _
'"Order by dbl_value_x"

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
"WHERE i_fk_measurement_group = '8' " & _
"Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_cm_m01) = 0 Then
	str_select = str_Con_Msg_07
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_cm_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
                </select>
              </div></td>
<td width="78" height="25" align="left" valign="bottom">
  <div align="left">
    <select name="LST_cm_deci_m01" size="1" class="fieldmeasured" id="LST_cm_deci_m01" style="">
      <%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 9 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_cm_deci_m01) = 0 Then
	str_select = str_Con_Msg_07a
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
      <option <%If lst_wert = Cint(lng_fk_cm_deci_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
      <%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">&nbsp;</td>
</tr>
<tr id="tab_feet_08_m01" style="display: none">
<td width="45" height="25" align="center" class="txtform">#1</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_08_m01" size="1" class="fieldmeasured" id="LST_feet_08_m01" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m01) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_08_m01" size="1" class="fieldmeasured" id="LST_inch_08_m01" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m01) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_eighths_inch_m01" size="1" class="fieldmeasured" id="LST_eighths_inch_m01" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 5 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_eighths_inch_m01) = 0 Then
	str_select = str_Con_Msg_09a
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_eighths_inch_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_feet_16_m01" style="display: none">
<td width="45" height="25" align="center" class="txtform">#1</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_16_m01" size="1" class="fieldmeasured" id="LST_feet_16_m01" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m01) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_16_m01" size="1" class="fieldmeasured" id="LST_inch_16_m01" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m01) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_sixteenth_m01" size="1" class="fieldmeasured" id="LST_sixteenth_m01" style="">
<%
'DropDown ----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 6 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

'If Cint(lng_fk_sixteenth_inch_m01) = 0 Or IsNull(lng_fk_sixteenth_inch_m01) or IsEmpty(lng_fk_sixteenth_inch_m01) or Len(lng_fk_sixteenth_inch_m01) = 0 Then
	str_select = str_Con_Msg_09b
%>
<option value="0"><%=str_Con_Msg_09b%></option>
<%
'end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
           <option <%If lst_wert = Cint(lng_fk_sixteenth_inch_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_feet_32_m01" style="display: none">
<td width="45" height="25" align="center" class="txtform">#1</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_32_m01" size="1" class="fieldmeasured" id="LST_feet_32_m01" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m01) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_32_m01" size="1" class="fieldmeasured" id="LST_inch_32_m01" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m01) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_thirtysecond_inch_m01" size="1" class="fieldmeasured" id="LST_thirtysecond_inch_m01" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 7 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_thirtysecond_inch_m01) = 0 Then
	str_select = str_Con_Msg_09c
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_thirtysecond_inch_m01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<%           
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
'Messung 02 -----------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
%>
<tr id="tab_cm_m02" style="display: none">
<td width="45" height="25" align="center" class="txtform">#2</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_cm_m02" size="1" class="fieldmeasured" id="LST_cm_m02" style="">
<%
'berechnet den Bereich der angezeigt werden soll 
'******************************************************************************
'fc_LST_range
'berechnet den bereich der im dropdown angezeigt werden soll
'i_value_last ... der letzte werte der einegeben wurde - um diesen Wert wird die matrix berechnet
'i_select_min ... der erste mögliche index im dropdown
'i_minus_value ... um wieviel der kleinste wert kleiner als der letzte wert sein soll
'i_select_max ... der letzte mögliche index im dropdown
'i_max_value ... um wieviel der größte wert größer als der letzte wert sein soll
'ix ... 1 >> berechnt den min - 2 >> berechnet den max
'Function fc_i_LST_range(i_value_last, i_select_min, i_minus_value, i_select_max, i_max_value, ix)
'i_range_min = fc_i_LST_range(lng_fk_cm_m02_last, 84, 5, 234, 10, 1)
'i_range_max = fc_i_LST_range(lng_fk_cm_m02_last, 84, 5, 234, 10, 2)
'Response.Write("lng_fk_cm_m01_last: " & lng_fk_cm_m01_last & "<br>")
'Response.Write("# i_range_min: " & i_range_min & "<br>")
'Response.Write("# i_range_max: " & i_range_max & "<br>")

'DropDown <>----------------------------------------------------------------------------------
'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 8 Order by dbl_value_x"

'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
'"WHERE i_fk_measurement_group = '8' " & _
'"AND lng_k_measurement >= '" & i_range_min & "'" & _
'"AND lng_k_measurement <= '" & i_range_max & "'" & _
'"Order by dbl_value_x"

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
"WHERE i_fk_measurement_group = '8' " & _
"Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_cm_m02) = 0 Then
	str_select = str_Con_Msg_07
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_cm_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_cm_deci_m02" size="1" class="fieldmeasured" id="LST_cm_deci_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 9 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_cm_deci_m02) = 0 Then
	str_select = str_Con_Msg_07a
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
      <option <%If lst_wert = Cint(lng_fk_cm_deci_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">&nbsp;</td>
</tr>
<tr id="tab_feet_08_m02" style="display:none">
<td width="45" height="25" align="center" class="txtform">#2</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_08_m02" size="1" class="fieldmeasured" id="LST_feet_08_m02" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m02) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_08_m02" size="1" class="fieldmeasured" id="LST_inch_08_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m02) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_eighths_inch_m02" size="1" class="fieldmeasured" id="LST_eighths_inch_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 5 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_eighths_inch_m02) = 0 Then
	str_select = str_Con_Msg_09a
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_eighths_inch_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_feet_16_m02" style="display: none">
<td width="45" height="25" align="center" class="txtform">#2</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_16_m02" size="1" class="fieldmeasured" id="LST_feet_16_m02" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m02) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_16_m02" size="1" class="fieldmeasured" id="LST_inch_16_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m02) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_sixteenth_m02" size="1" class="fieldmeasured" id="LST_sixteenth_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 6 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_sixteenth_inch_m02) = 0 Then
	str_select = str_Con_Msg_09b
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_sixteenth_inch_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_feet_32_m02" style="display: none">
<td width="45" height="25" align="center" class="txtform">#2</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_32_m02" size="1" class="fieldmeasured" id="LST_feet_32_m02" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m02) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_32_m02" size="1" class="fieldmeasured" id="LST_inch_32_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m02) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_thirtysecond_inch_m02" size="1" class="fieldmeasured" id="LST_thirtysecond_inch_m02" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 7 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_thirtysecond_inch_m02) = 0 Then
	str_select = str_Con_Msg_09c
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_thirtysecond_inch_m02) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_cm_m03" style="display: none">
<td width="45" height="25" align="center" class="txtform">#3</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_cm_m03" size="1" class="fieldmeasured" id="LST_cm_m03" style="">
<%
'berechnet den Bereich der angezeigt werden soll 
'******************************************************************************
'fc_LST_range
'berechnet den bereich der im dropdown angezeigt werden soll
'i_value_last ... der letzte werte der einegeben wurde - um diesen Wert wird die matrix berechnet
'i_select_min ... der erste mögliche index im dropdown
'i_minus_value ... um wieviel der kleinste wert kleiner als der letzte wert sein soll
'i_select_max ... der letzte mögliche index im dropdown
'i_max_value ... um wieviel der größte wert größer als der letzte wert sein soll
'ix ... 1 >> berechnt den min - 2 >> berechnet den max
'Function fc_i_LST_range(i_value_last, i_select_min, i_minus_value, i_select_max, i_max_value, ix)
'i_range_min = fc_i_LST_range(lng_fk_cm_m03_last, 84, 5, 234, 10, 1)
'i_range_max = fc_i_LST_range(lng_fk_cm_m03_last, 84, 5, 234, 10, 2)
'Response.Write("lng_fk_cm_m01_last: " & lng_fk_cm_m01_last & "<br>")
'Response.Write("# i_range_min: " & i_range_min & "<br>")
'Response.Write("# i_range_max: " & i_range_max & "<br>")

'DropDown <>----------------------------------------------------------------------------------
'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 8 Order by dbl_value_x"

'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
'"WHERE i_fk_measurement_group = '8' " & _
'"AND lng_k_measurement >= '" & i_range_min & "'" & _
'"AND lng_k_measurement <= '" & i_range_max & "'" & _
'"Order by dbl_value_x"

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
"WHERE i_fk_measurement_group = '8' " & _
"Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_cm_m03) = 0 Then
	str_select = str_Con_Msg_07
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_cm_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
                  <%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_cm_deci_m03" size="1" class="fieldmeasured" id="LST_cm_deci_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 9 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_cm_deci_m03) = 0 Then
	str_select = str_Con_Msg_07a
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
      <option <%If lst_wert = Cint(lng_fk_cm_deci_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">&nbsp;</td>
</tr>
<%           
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
'Messung 03 -----------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
'------------------------------------------------------------------------------------------------------
%>
<tr id="tab_feet_08_m03" style="display: none">
<td width="45" height="25" align="center" class="txtform">#3</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_08_m03" size="1" class="fieldmeasured" id="LST_feet_08_m03" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m03) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_08_m03" size="1" class="fieldmeasured" id="LST_inch_08_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m03) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_eighths_inch_m03" size="1" class="fieldmeasured" id="LST_eighths_inch_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 5 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_eighths_inch_m03) = 0 Then
	str_select = str_Con_Msg_09a
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_eighths_inch_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_feet_16_m03" style="display: none">
<td width="45" height="25" align="center" class="txtform">#3</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_16_m03" size="1" class="fieldmeasured" id="LST_feet_16_m03" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m03) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
                  <option <%If lst_wert = Cint(lng_fk_feet_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_16_m03" size="1" class="fieldmeasured" id="LST_inch_16_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m03) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_sixteenth_m03" size="1" class="fieldmeasured" id="LST_sixteenth_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 6 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_sixteenth_inch_m03) = 0 Then
	str_select = str_Con_Msg_09b
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_sixteenth_inch_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr id="tab_feet_32_m03" style="display: none">
<td width="45" height="25" align="center" class="txtform">#3</td>
<td width="80" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_feet_32_m03" size="1" class="fieldmeasured" id="LST_feet_32_m03" >
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 1 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_feet_m03) = 0 Then
	str_select = str_Con_Msg_08 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")

%>
            <option <%If lst_wert = Cint(lng_fk_feet_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_inch_32_m03" size="1" class="fieldmeasured" id="LST_inch_32_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 2 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_inch_m03) = 0 Then
	str_select = str_Con_Msg_09 
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_inch_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="247" height="25" align="left" valign="bottom">
<div align="left">
<select name="LST_thirtysecond_inch_m03" size="1" class="fieldmeasured" id="LST_thirtysecond_inch_m03" style="">
<%
'DropDown <>----------------------------------------------------------------------------------
SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 7 Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_thirtysecond_inch_m03) = 0 Then
	str_select = str_Con_Msg_09c
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_thirtysecond_inch_m03) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
</tr>
<tr>
    <td width="45" height="25" class="txtform">&nbsp;</td>
<td height="30" colspan="3" align="left" valign="bottom">
    <span class="txtform"><span class="Stil8 txtform"><strong><span class="Stil8"><span class="Stil10"><%= fc_value_string(Session("ses_i_language"), "var_meas_at_36") %>&nbsp;</span><%= str_measured_mm_athlete_average %></span></strong></span></span>
    <img style="margin: 0px 3px 0px 0px; float: right; top: 5px; position: relative;" src="images/ico/help16.png" alt="" width="16" height="16" hspace="10" class="help" onMouseOver="Tip('<%= hint_128 %>', TITLE, '<div class=\'TitleCls\'><%= hint_title_128 %></div>')" onMouseOut="UnTip()" />
</td>
</tr>
<tr>
<td style="padding-top: 10mm;" colspan="4" valign="bottom" class="txttable">
    <strong><img src="images/ico/weight32.png" width="32" height="32" hspace="5" border="0" /><%= fc_value_string(Session("ses_i_language"), "var_meas_at_11") %> </strong>&nbsp;<%= fc_value_string(Session("ses_i_language"), "var_meas_at_13") %>
    <img style="margin: 0px 3px 0px 0px; float: right; top: 15px; position: relative;" src="images/ico/help16.png" alt="" width="16" height="16" hspace="10" class="help" onMouseOver="Tip('<%= hint_130 %>', TITLE, '<div class=\'TitleCls\'><%= hint_title_130 %></div>')" onMouseOut="UnTip()" />
</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
</tr>
<tr id="tab_kg_m01" style="display: none">
<td width="45" height="27" align="center" valign="middle" class="txtform">Kg</td>
<td width="80" height="27" align="left" valign="bottom">
<div align="left">

<select name="LST_kg" size="1" class="fieldmeasured" id="LST_kg" style="">
<%
'berechnet den Bereich der angezeigt werden soll 
'******************************************************************************
'fc_LST_range
'berechnet den bereich der im dropdown angezeigt werden soll
'i_value_last ... der letzte werte der einegeben wurde - um diesen Wert wird die matrix berechnet
'i_select_min ... der erste mögliche index im dropdown
'i_minus_value ... um wieviel der kleinste wert kleiner als der letzte wert sein soll
'i_select_max ... der letzte mögliche index im dropdown
'i_max_value ... um wieviel der größte wert größer als der letzte wert sein soll
'ix ... 1 >> berechnt den min - 2 >> berechnet den max
'Function fc_i_LST_range(i_value_last, i_select_min, i_minus_value, i_select_max, i_max_value, ix)
'i_range_min = fc_i_LST_range(lng_kg_01_last, 545, 5, 815, 10, 1)
'i_range_max = fc_i_LST_range(lng_kg_01_last, 545, 5, 815, 10, 2)
'Response.Write("lng_fk_cm_m01_last: " & lng_fk_cm_m01_last & "<br>")
'Response.Write("# i_range_min: " & i_range_min & "<br>")
'Response.Write("# i_range_max: " & i_range_max & "<br>")

'DropDown <>----------------------------------------------------------------------------------
'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 11 Order by dbl_value_x"

'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
'"WHERE i_fk_measurement_group = '11' " & _
'"AND lng_k_measurement >= '" & i_range_min & "'" & _
'"AND lng_k_measurement <= '" & i_range_max & "'" & _
'"Order by dbl_value_x"

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
"WHERE i_fk_measurement_group = '11' " & _
"Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_kg_01) = 0 Then
	str_select = str_Con_Msg_09d
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_kg_01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="27" align="left" valign="bottom">&nbsp;</td>
<td width="247" height="27" align="left" valign="bottom">&nbsp;</td>
</tr>
<tr id="tab_lbs" style="display: none">
<td width="45" height="26" align="center" valign="middle" class="txtform">lbs</td>
<td width="80" height="26" align="left" valign="bottom">
<div align="left">
<select name="LST_lbs" size="1" class="fieldmeasured" id="LST_lbs" style="">
<%
'berechnet den Bereich der angezeigt werden soll 
'******************************************************************************
'fc_LST_range
'berechnet den bereich der im dropdown angezeigt werden soll
'i_value_last ... der letzte werte der einegeben wurde - um diesen Wert wird die matrix berechnet
'i_select_min ... der erste mögliche index im dropdown
'i_minus_value ... um wieviel der kleinste wert kleiner als der letzte wert sein soll
'i_select_max ... der letzte mögliche index im dropdown
'i_max_value ... um wieviel der größte wert größer als der letzte wert sein soll
'ix ... 1 >> berechnt den min - 2 >> berechnet den max
'Function fc_i_LST_range(i_value_last, i_select_min, i_minus_value, i_select_max, i_max_value, ix)
'i_range_min = fc_i_LST_range(lng_fk_lbs_01_last, 30, 5, 544, 10, 1)
'i_range_max = fc_i_LST_range(lng_fk_lbs_01_last, 30, 5, 544, 10, 2)
'Response.Write("lng_fk_lbs_01_last: " & lng_fk_lbs_01_last & "<br>")
'Response.Write("# i_range_min: " & i_range_min & "<br>")
'Response.Write("# i_range_max: " & i_range_max & "<br>")

'DropDown <>----------------------------------------------------------------------------------
'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units WHERE i_fk_measurement_group = 10 Order by dbl_value_x"

'SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
'"WHERE i_fk_measurement_group = '10' " & _
'"AND lng_k_measurement >= '" & i_range_min & "'" & _
'"AND lng_k_measurement <= '" & i_range_max & "'" & _
'"Order by dbl_value_x"

SQL = "SELECT lng_k_measurement, str_readout FROM tbl_0512_measured_units " & _
"WHERE i_fk_measurement_group = '10' " & _
"Order by dbl_value_x"

	Set rst_tmp = Server.CreateObject("ADODB.Recordset")
		rst_tmp.Open SQL, objConn, adOpenStatic, adLockReadOnly   

If Cint(lng_fk_lbs_01) = 0 Then
	str_select = str_Con_Msg_09e
%>
<option value="0"><%=str_select%></option>
<%
end if

    If Not rst_tmp.EOF Then
	     Do While Not rst_tmp.EOF
          
           	lst_wert = rst_tmp.Fields("lng_k_measurement")
		    lst_string = rst_tmp.Fields("str_readout")
%>
                  <option <%If lst_wert = Cint(lng_fk_lbs_01) Then %>selected<%end if%> value="<%=lst_wert%>"><%=lst_string%></option>
<%
             rst_tmp.MoveNext
			 
        Loop
  	End if

		rst_tmp.Close
set rst_tmp = Nothing
'------------------------------------------------------------------------------------------------------
%>
</select>
</div></td>
<td width="78" height="26" align="left" valign="bottom">&nbsp;</td>
<td width="247" height="26" align="left" valign="bottom">&nbsp;</td>
</tr>
</table>
<table width="465" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td width="45" style="padding-top: 12mm;">&nbsp;</td>
        <td width="420" valign="bottom"><div align="left">
         <% 
         'Submit > Eintragen
         'Clear > Löschen
          %>
          <input style="width: 96px;" name="btnSub_01" type="submit" class="button100" value="<%= fc_value_string(Session("ses_i_language"), "var_invite_global_10") %>" />
          <input style="width: <% if Session("ses_i_language") = 2 then %>138<% else %>213<% end if %>px; margin-left: 22px; padding-left: 5px;" name="btnSub_03" type="submit" title="<%= fc_value_string(Session("ses_i_language"), "var_hints_28") %>" class="button250" value="<%= fc_value_string(Session("ses_i_language"), "var_invite_global_25") %>" />

        </div></td>
    </tr>
    <tr>
        <td width="45">&nbsp;</td>
        <td width="420" valign="top" class="txtblock11">
            <div style="margin-top: 10mm;">
                <strong><%= fc_value_string(Session("ses_i_language"), "var_meas_at_17") %></strong>
                <br />
                <p><%= fc_value_string(Session("ses_i_language"), "var_meas_at_18") %></p>
            </div>
        </td>
    </tr>
    <% If i_insert_error > 0 Then %>
    <tr valign="top">
        <td width="45" >&nbsp;</td>
        <td height="26" colspan="2">
            
            <table width="400" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td class="txtlegal Stil9"><br />
                    <%= fc_value_string(Session("ses_i_language"), "var_meas_at_32") %><br />
                    <br /><%= str_insert_error_msg %></td>
                </tr>
            </table>
        </td>
    </tr>
    <% end if %>
</table>
</td>
<td width="29" align="center" valign="bottom">&nbsp;</td>
<td width="29" align="center" valign="bottom">&nbsp;</td>
<td width="29" align="center" valign="bottom">&nbsp;</td>
</tr>
</table>
</form>
</div>
<!--End of the first tab-->

<!--Second tab-->
<div id="page-enclosure-a2" style="display: none;">
    <form style="padding: 0px; margin: 0px;" method="Post" action="athlete_measured_data.asp?active_tab=a2&AP=<%=AP%>" onSubmit="return Form_inputcheck(this)" name="frm_history">
    <table width="650" border="0" cellspacing="4" cellpadding="0" style="position: relative; top: -25px;">
    <tr>
        <td width="38" rowspan="2" valign="top"><a name="listing"></a></td>
        <td colspan="2">
<%
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Start Andrey Info 07 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

'Angabe der aktuell angeforderten Seite
Dim intAbsolutePage
    intAbsolutePage = cbToggleValue ( _
                                     cbInteger( _
                                               Request("AP") _
                                              ) _
                                     , " < 1" _
                                     , 1 _
                                    )
'Angabe der Seiten insgesamt (wird spaeter aus dem Recordset-Objekt ausgelesen)
Dim intPageCount
    intPageCount = 1
'Anzahl der Datensaetze
Dim intRecordCount
    intRecordCount = 1
'Angabe der Seitengroesse
Dim intPageSize
Dim rop
rop = Request("rop")
If rop = "" Then
	If Session("rop") <> "" Then
		rop = Session("rop")
	End If
Else 
	Session("rop") = rop
End If
If rop <> "" Then
	intPageSize = rop
Else
	intPageSize = 10
End If
'Angabe der Anzahl der Links in der Pagingleiste
Dim intMaxPageLinks
    intMaxPageLinks = 10
'Variable zur Zaehlung der schon ausgegebenen Zeilen
Dim intRowCounter
    intRowCounter = 1

Dim strLinkURL
Dim strLinkParam
Dim sqlCommand1
Dim sqlCommand2	

Dim str_color_01
Dim str_color_02
Dim str_color_03
Dim str_color_master

Dim i_color
i_color = 1 'default
str_color_01= "#FFF2C1"'hellblau
str_color_02= "#E4F1C7"'mittelblau
str_color_03 ="#FFD7EB"'hellrot für einen neuen datensatz

'Alle -----------------------------------------------------------------
If i_filter_passive = 1 Then'Alle
sqlCommand1 = "SELECT * FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & "' And i_measured_series ='" & 1 & _
"' ORDER BY dt_measured DESC, i_number_of_changes"  & _
" LIMIT  " & (intAbsolutePage  - 1) * _
			intPageSize & _
	   ", " & intPageSize

'Response.Write(sqlCommand1 & "<br>")
'Response.End()

sqlCommand2 = "SELECT COUNT(1) AS lng_fk_User_ID FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & "' And i_measured_series ='" & 1 & "'"
end if

'Nur Aktive -----------------------------------------------------------------
If i_filter_passive = 2 Then'Nur Aktive
	'sqlCommand1 = "SELECT * FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & "' And i_measured_series ='" & 1 & "' And i_number_of_changes ='" & 0 & _
	'"' ORDER BY dt_measured DESC, i_number_of_changes"  & _
	'" LIMIT  " & (intAbsolutePage  - 1) * _
	'		  intPageSize & _
	'	 ", " & intPageSize
	''Response.Write(sqlCommand1 & "<br>")
	''Response.End()
	'
	'sqlCommand2 = "SELECT COUNT(1) AS lng_fk_User_ID FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & _
	'"' And i_measured_series ='" & 1 & "' And i_number_of_changes ='" & 0 & "'"
	
	'20120318
	sqlCommand1 = "SELECT * FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & "' And i_measured_series ='" & 1 & "' And i_passiv_public ='" & 1 & _
	"' ORDER BY dt_measured DESC, i_number_of_changes"  & _
	" LIMIT  " & (intAbsolutePage  - 1) * _
			  intPageSize & _
		 ", " & intPageSize
	
	'Response.Write(sqlCommand1 & "<br>")
	'Response.End()
	
	sqlCommand2 = "SELECT COUNT(1) AS lng_fk_User_ID FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' AND i_fk_measured_type = '" & 4 & _
	"' And i_measured_series ='" & 1 & "' And i_passiv_public ='" & 1 & "'"
	
	
	'Response.Write(sqlCommand2 & "<br>")
end if


Set objRS = Server.CreateObject("ADODB.Recordset")

    objRS.Open sqlCommand2, objConn, adOpenStatic, adLockReadOnly   
        intRecordCount = Cint(objRS.Fields("lng_fk_User_ID"))
    objRS.Close

'Response.Write("intRecordCount: " & intRecordCount & "<br>")
	
    'Ermitteln der Seitenanzahl
    intPageCount = intRecordCount / intPageSize

'org
'    If intPageCount Mod intPageSize <> 0 Then
'        intPageCount = intPageCount + 1
'    End if

'nur wenn der index die max pro Seite übersteigt gibt es eine zusätzliche Seite
    If intPageCount Mod intPageSize <> 0 and intPageCount > 1 Then
        intPageCount = intPageCount + 1
    End if
     
    objRS.Open sqlCommand1, objConn, adOpenStatic, adLockReadOnly   
    
function Ceil( PNumber )
  Dim result
  result = Int( PNumber )
  if result <> PNumber then
    result = result + 1
  end if
  Ceil = result
end function

Dim i
Dim count_rows, pages, page, rad, links, html, start, end1, rop_html
strLinkParam = "iu=" & iu & "&ig=" & ig
count_rows = intRecordCount
pages = Ceil(count_rows / intPageSize)
page = intAbsolutePage
If isEmpty(page) Then
	page = 1
End If
If page > pages Then
	page = 1
End If
rad = 1
links = rad * 2 + 1
html = "<div style='text-align: left;' class='paginator'>"
If page > 1 Then
	html = html & "<a href='?active_tab=a2&" & strLinkParam & "&AP=1&rop=" & intPageSize & "' title='1'>&laquo;&laquo;&laquo;</a>&nbsp;&nbsp;<a href='?active_tab=a2&" & strLinkParam & "&AP=" & (page - 1) & "&rop=" & intPageSize & "' title='" & (page - 1) & "'>&laquo;&laquo;</a>&nbsp;"
End If
start = page - 2
If start > (pages - links) Then
	start = pages - links
End If
If start < 0 Then
	start = 0
End If
'end1 = start + links - 1
end1 = page
If end1 >= pages Then
	end1 = pages - 1
End If

For i = start To end1
	html = html & "&nbsp;"
	If i = page - 1 Then
		html = html & "<b>"
	Else
		html = html & "<a href='?active_tab=a2&" & strLinkParam & "&AP=" & (i + 1) & "&rop=" & intPageSize & "' title='" & (i + 1) & "'>"
	End If

	html = html & "[" & (i * intPageSize + 1) & "-"
	If i <> (pages - 1) Then
		html = html & (i * intPageSize + intPageSize) & "]"
	Else
		html = html & count_rows & "]"
	End If
	If i = page - 1 Then
		html = html & "</b>"
	Else
		html = html & "</a>"
	End If
	
Next
'If (pages - 1) > (links + 1) And (page + 1) < (pages - rad - 1) Then
If page < (pages - 1)  Then
	html = html & " ... <a href='?active_tab=a2&" & strLinkParam & "&AP=" & (pages - 1) & "&rop=" & intPageSize & "' title='" & (pages - 1) & "'>[" & ( (pages - 1) * intPageSize + 1) & "-" & (count_rows) & "]</a>"
End If
If page < (pages ) Then
	html = html & "&nbsp;&nbsp;<a href='?active_tab=a2&" & strLinkParam & "&AP=" & (page + 1) & "&rop=" & intPageSize & "' title='" & (page + 1) & "'>&raquo;&raquo;</a>&nbsp;&nbsp;<a href='?active_tab=a2&" & strLinkParam & "&AP=" & (pages) & "&rop=" & intPageSize & "' title='" & (pages) & "'>&raquo;&raquo;&raquo;</a>"
End If
html = html & "</div>"

rop_html = "<div style='text-align: left;' class='paginator'>" & str_line_header

If rop = 10 Or rop = "" Then
	rop_html = rop_html & "<b>10</b> | "	
Else
	rop_html = rop_html & "<a href='?active_tab=a2&" & strLinkParam & "&AP=" & Request("AP") & "&rop=10'>10</a> | "
End If
If rop = 20 Then
	rop_html = rop_html & "<b>20</b> | "
Else
	rop_html = rop_html & "<a href='?active_tab=a2&" & strLinkParam & "&AP=" & Request("AP") & "&rop=20'>20</a> | "
End If
If rop = 50 Then
	rop_html = rop_html & "<b>50</b>"
Else
	rop_html = rop_html & "<a href='?active_tab=a2&" & strLinkParam & "&AP=" & Request("AP") & "&rop=50'>50</a>"
End If
rop_html = rop_html & "</div>"
'if err.number then
'	response.write("PAGINATOR ERROR: " & err.description & "<br>")
'end if

'If i_month_back_user <> Con_i_month_back and i_month_back_user < 0 Then 
If 1 > 2 Then
%>
<%= fc_value_string(Session("ses_i_language"), "var_meas_at_26") %> <%= i_month_back_user_info %> <%= fc_value_string(Session("ses_i_language"), "var_meas_at_16") %>
<% 
end if
%>
<table width="100%" border="0" style="position: relative;">
    <tr>
        <td  class="txtform" style="text-align: left; width: 430px;"><%= rop_html %></td>
        <td>&nbsp;</td>
        <td style="text-align: right;">
            <div style="position: relative; left: -5px;">
                <label class="txtblock11" title="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_20") %>" alt="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_20") %>">
                       <input name="optR01" type="radio" value= 1 title="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_20") %>" alt="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_20") %>" <%If i_filter_passive = 1 Then %>checked<%end if%> onClick="javascript: refresh_window_filter(1)"/>
                       <%= fc_value_string(Session("ses_i_language"), "var_glob_txt_1027") %>
                </label>
                <label class="txtblock11" title="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_21") %>" alt="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_21") %>">
                    <input name="optR01" type="radio" value= 2 title="<%= fc_value_string(Session("ses_i_language"), "var_hints_67") %>" alt="<%= fc_value_string(Session("ses_i_language"), "var_hints_67") %>" <%If i_filter_passive = 2 Then %>checked<%end if%> onClick="javascript: refresh_window_filter(2)"/>
                    <%= fc_value_string(Session("ses_i_language"), "var_meas_at_22") %>
                </label>
           </div>
        </td>
    </tr>
    <tr>
        <td colspan='2' height="30" class="txtform" style="text-align: left; vertical-align: top; padding-top: 10px; padding-left: 150px;"><%= html%></td>
        <td style="text-align: right; vertical-align: top;">
            <input style="position: relative; left: -5px; top: -3px; padding-top: 5px;" name="btnSubpassive" type="image" title="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_23") %>" value="Passive Measurements" src="images/ico/measure_delete24.png" alt="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_23") %>" width="24" height="24" vspace="2" border="0" onClick="javascript: check_save(2)"/>
        </td>
  </tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="position: relative;">
<%
i_dyna_counter = 0

Dim str_measured_01
Dim str_measured_02
Dim str_measured_03

Dim str_measured_mm
Dim str_measured_gewicht

Dim i_fk_measured_system
Dim lng_fk_cm
Dim lng_fk_cm_deci

Dim lng_fk_kg
Dim lng_fk_lbs

Dim lng_fk_feet
Dim lng_fk_inch
Dim lng_fk_eighths_inch
Dim lng_fk_sixteenth_inch
Dim lng_fk_thirtysecond_inch

Dim sqlmeasured
Dim rs

Dim lng_User_ID_update
Dim str_filename' der name der grafik wer den datensatz gespeichert hat

Dim i_number_of_changes
Dim str_passive
str_passive = "Passive"
i_number_of_changes = 0 'default

'20120318
'Änderung neues Feld wenn eine Messung kleiner wird
'das bestehende Feld für Passiv <i_number_of_changes> ist nur mehr für Andrey
'wenn ein Athlete eine Messung als Passiv setzt wird nurmehr dieses Feld verwendet
'wenn die Messung als zu klein eingestuft wird dann wird nurmehr das alte feld <i_number_of_changes> verwendet
Dim i_passiv_public'1=Active/2=Passive

i_dyna_counter = 0

Do While Not objRS.EOF And intRowCounter <= intPageSize
		
		i_dyna_counter = i_dyna_counter + 1
		
		'dyn. namensgebung
		ID_dt_measured_x = "ID_dt_measured_" & i_dyna_counter
		ckk_i_passive_x = "ckk_i_passive_" & i_dyna_counter
		
		If i_color = 1 Then
			str_color_master = str_color_01
			i_color = 0
		else
			str_color_master = str_color_02
			i_color = 1
		end if
		
		'liest den datensatz ein
		dt_measured = objRS.Fields("dt_measured").Value 
		i_number_of_changes = objRS.Fields("i_number_of_changes").Value'ob der tag geändert wurde
		
		'20120318
		i_passiv_public = objRS.Fields("i_passiv_public").Value'1=Active/2=Passive
		
		If dt_measured > 0 Then
			dt_measured = fc_str_date_server_format(dt_measured, 3)'ausgabeformat
			ID_dt_measured = fc_str_date_server_format(dt_measured, 3)'serverformat
		end if

'holte jetzt alle drei messungen
	sqlmeasured = "SELECT * FROM tbl_0801_athlete_measured WHERE lng_fk_User_ID = '" & iu & "' " & _
	"AND i_fk_measured_type = '" & 4 & "' " & _
	"AND dt_measured = '" & dt_measured & "' " & _
	"AND i_number_of_changes = '" & i_number_of_changes & "' " & _
	"ORDER BY dt_measured DESC, i_measured_series, i_number_of_changes"
	
	'Response.Write("sqlmeasured: " & sqlmeasured & "<br>")	
	
	Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sqlmeasured, objConn, adOpenStatic, adLockReadOnly   

	i = 0'default
	
	Do While Not rs.EOF
	
		i = i + 1
		
		lng_User_ID_update = rs.Fields("lng_fk_User_ID_update").Value
		If IsNull(lng_User_ID_update) or IsEmpty(lng_User_ID_update) Then
			lng_User_ID_update = iu
		end if
		If Cint(lng_User_ID_update) <> Cint(iu) Then
			str_filename = "trainers16.png"'trainereingabe
			var_hints_34_35 = var_hints_35
		else
			str_filename ="athlete16.png"'athlete
			var_hints_34_35 = var_hints_34
		end if

'measurement_system
'0	+++please select+++	
'1	metric				
'2	feet - inch -1/8	
'3	feet - inch -1/16	
'4	feet - inch -1/32

		'If i = 1 Then
			i_fk_measured_system = rs.Fields("i_fk_measured_system").Value 
		'end if
		'Response.Write("i_fk_measured_system: " & i_fk_measured_system & "<br>")

'1	metric -----------------------------------------------------------------------------------------	
		'# 1. messung 
		If i_fk_measured_system = 1 and i = 1 Then
			lng_fk_cm = rs.Fields("lng_fk_cm").Value 
			lng_fk_cm_deci = rs.Fields("lng_fk_cm_deci").Value
			lng_fk_kg = rs.Fields("lng_fk_kg").Value
						
			str_measured_01 = fc_get_metric_value(lng_fk_cm)
			str_measured_01 = "cm " & (str_measured_01 ) + (fc_get_metric_value(lng_fk_cm_deci))
			str_measured_gewicht = "kg " & fc_get_metric_value(lng_fk_kg)
		end if
		
		'# 2. messung 
		If i_fk_measured_system = 1 and i = 2 Then
			lng_fk_cm = rs.Fields("lng_fk_cm").Value 
			lng_fk_cm_deci = rs.Fields("lng_fk_cm_deci").Value
			
			str_measured_02 = fc_get_metric_value(lng_fk_cm)
			str_measured_02 =  "cm " & (str_measured_02 ) + (fc_get_metric_value(lng_fk_cm_deci))
		end if

		'# 3. messung 
		If i_fk_measured_system = 1 and i = 3 Then
			lng_fk_cm = rs.Fields("lng_fk_cm").Value 
			lng_fk_cm_deci = rs.Fields("lng_fk_cm_deci").Value
			
			str_measured_03 = fc_get_metric_value(lng_fk_cm)
			str_measured_03 =  "cm " & (str_measured_03 ) + (fc_get_metric_value(lng_fk_cm_deci))
		end if
		
'2	feet - inch -1/8 -----------------------------------------------------------------------------------------	
		'# 1. messung 
		If i_fk_measured_system = 2 and i = 1 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_eighths_inch = rs.Fields("lng_fk_eighths_inch").Value
			lng_fk_lbs = rs.Fields("lng_fk_lbs").Value
			
			str_measured_01 = fc_get_value_x(lng_fk_feet)
			str_measured_01 = (str_measured_01 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_01 = (str_measured_01 ) & "'' " & (fc_get_value_x(lng_fk_eighths_inch)) & "/8''"
			str_measured_gewicht = "lbs " & fc_get_value_x(lng_fk_lbs)
		end if
		
		'# 2. messung 
		If i_fk_measured_system = 2 and i = 2 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_eighths_inch = rs.Fields("lng_fk_eighths_inch").Value
			
			str_measured_02 = fc_get_value_x(lng_fk_feet)
			str_measured_02 = (str_measured_02 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_02 = (str_measured_02 ) & "'' " & (fc_get_value_x(lng_fk_eighths_inch)) & "/8''"
		end if

		'# 3. messung 
		If i_fk_measured_system = 2 and i = 3 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_eighths_inch = rs.Fields("lng_fk_eighths_inch").Value
			
			str_measured_03 = fc_get_value_x(lng_fk_feet)
			str_measured_03 = (str_measured_03 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_03 = (str_measured_03 ) & "'' " & (fc_get_value_x(lng_fk_eighths_inch)) & "/8''"

		end if

'2	feet - inch -1/16 -----------------------------------------------------------------------------------------	
		'# 1. messung 
		If i_fk_measured_system = 3 and i = 1 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_sixteenth_inch = rs.Fields("lng_fk_sixteenth_inch").Value
			lng_fk_lbs = rs.Fields("lng_fk_lbs").Value
			
			str_measured_01 = fc_get_value_x(lng_fk_feet)
			str_measured_01 = (str_measured_01 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_01 = (str_measured_01 ) & "'' " & (fc_get_value_x(lng_fk_sixteenth_inch)) & "/16''"
			str_measured_gewicht = "lbs " & fc_get_value_x(lng_fk_lbs)
		end if
		
		'# 2. messung 
		If i_fk_measured_system = 3 and i = 2 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_sixteenth_inch = rs.Fields("lng_fk_sixteenth_inch").Value
			
			str_measured_02 = fc_get_value_x(lng_fk_feet)
			str_measured_02 = (str_measured_02 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_02 = (str_measured_02 ) & "'' " & (fc_get_value_x(lng_fk_sixteenth_inch)) & "/16''"
		end if

		'# 3. messung 
		If i_fk_measured_system = 3 and i = 3 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_sixteenth_inch = rs.Fields("lng_fk_sixteenth_inch").Value
			
			str_measured_03 = fc_get_value_x(lng_fk_feet)
			str_measured_03 = (str_measured_03 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_03 = (str_measured_03 ) & "'' " & (fc_get_value_x(lng_fk_sixteenth_inch)) & "/16''"

		end if
				
'2	feet - inch -1/32 -----------------------------------------------------------------------------------------	
		'# 1. messung 
		If i_fk_measured_system = 4 and i = 1 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_thirtysecond_inch = rs.Fields("lng_fk_thirtysecond_inch").Value
			lng_fk_lbs = rs.Fields("lng_fk_lbs").Value
			
			str_measured_01 = fc_get_value_x(lng_fk_feet)
			str_measured_01 = (str_measured_01 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_01 = (str_measured_01 ) & "'' " & (fc_get_value_x(lng_fk_thirtysecond_inch)) & "/32''"
			str_measured_gewicht = "lbs " & fc_get_value_x(lng_fk_lbs)
		end if
		
		'# 2. messung 
		If i_fk_measured_system = 4 and i = 2 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_thirtysecond_inch = rs.Fields("lng_fk_thirtysecond_inch").Value
			
			str_measured_02 = fc_get_value_x(lng_fk_feet)
			str_measured_02 = (str_measured_02 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_02 = (str_measured_02 ) & "'' " & (fc_get_value_x(lng_fk_thirtysecond_inch)) & "/32''"
		end if

		'# 3. messung 
		If i_fk_measured_system = 4 and i = 3 Then
			lng_fk_feet = rs.Fields("lng_fk_feet").Value 
			lng_fk_inch = rs.Fields("lng_fk_inch").Value
			lng_fk_thirtysecond_inch = rs.Fields("lng_fk_thirtysecond_inch").Value
			
			str_measured_03 = fc_get_value_x(lng_fk_feet)
			str_measured_03 = (str_measured_03 ) & "' " & (fc_get_value_x(lng_fk_inch))
			str_measured_03 = (str_measured_03 ) & "'' " & (fc_get_value_x(lng_fk_thirtysecond_inch)) & "/32''"
		end if
		
	'Response.Write("i zähler: " & i & "<br>")
	rs.MoveNext
	Loop
	
	rs.Close
	set rs = Nothing

'holt jetzt die durchschnittsgröße --------------------
'Dim dbl_measured_gewicht
'Dim dbl_measured_mm
'Dim str_measured_gewicht
'Dim str_measured_mm

'20110327 -  es können mehrere datensatze pro tag gefunden werden
'deshalb muss auch <i_number_of_changes> mit einbezogen werden
	sqlmeasured = "SELECT dbl_measured_mm, dbl_measured_kg FROM tbl_0802_athlete_calculated " & _
	"WHERE lng_fk_User_ID = '" & iu & "' " & _
	"AND i_fk_measured_type = '" & 4 & "' " & _
	"AND i_number_of_changes = '" & i_number_of_changes & "' " & _
	"AND dt_measured = '" & dt_measured & "'"
	
	Set rs = Server.CreateObject("ADODB.Recordset")
    rs.Open sqlmeasured, objConn, adOpenStatic, adLockReadOnly   
	
	Do While Not rs.EOF
		str_measured_mm = rs.Fields("dbl_measured_mm").Value
	rs.MoveNext
	Loop
	rs.Close
	set rs = Nothing

'Formatierung
'i_fk_measured_system
'0	+++please select+++
'1	metric			
'2	feet - inch -1/8
'3	feet - inch -1/16
'4	feet - inch -1/32

'der ausgabewert als string 
'******************************************************************************
' gibt den durchschnittswert als string zurück, zb. der abgespeicherte wert ist immer metric >> der angezeigte soll zb: 3'' 1' 10/32' sein
' InputParameter:
' dbl_measured_mm_athlete ... der metrische wert
' i_fk_measured_system ... welches messsystem
'******************************************************************************
'Function fc_get_str_average_value(dbl_measured_mm_athlete_average, i_fk_measured_system)
		str_measured_mm = fc_get_str_average_value(str_measured_mm, i_fk_measured_system)
'ausgabeformat nur für den User - kommt darauf an was im dropdown auswählt
'1	dd.mm.yyyy
'2	mm.dd.yyyy		
		If i_fk_date_format = 1 Then
			dt_measured = fc_str_date_server_format(dt_measured, 5)
		end if
		If i_fk_date_format = 2 Then
			dt_measured = fc_str_date_server_format(dt_measured, 6)
		end if

'If i_number_of_changes > 0 Then
'	str_color_master = "#CECECE"
'end if
'20120318
'Response.Write("i_passiv_public: " & i_passiv_public & "<br>")
If i_passiv_public = 2 Then'1=Active/2=Passive
	str_color_master = "#CECECE"
end if
%>
<tr>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting">&nbsp;<%= dt_measured %>            
<input name="<%=ID_dt_measured_x%>" type="hidden" class="txtsmlisting" value="<%=ID_dt_measured%>" size="8" /></td>
<td width="18" align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><div align="center" class="Stil11 Stil12">
<div align="left">&raquo;</div>
</div></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><%= str_measured_01 %></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting Stil12"><div align="left"><span class="Stil11 Stil12">&raquo;</span></div></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><%= str_measured_02 %></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><div align="center" class="Stil12">
<div align="left"><span class="Stil11 Stil12">&raquo;</span></div>
</div></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><%= str_measured_03 %></div></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><div align="center" class="Stil12">
<div align="left"><span class="Stil11 Stil12">&raquo;</span></div>
</div></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><strong class="Stil10" ><%= str_measured_mm %></strong></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting Stil12"><div align="left"><span class="Stil11 Stil12">&raquo;</span></div></td>
<td align="left" bgcolor="<%= str_color_master %>" class="txtsmlisting"><%= str_measured_gewicht %></td>
<td bgcolor="<%= str_color_master %>" class="txtsmlisting"><div align="center" class="Stil14"><img src="images/ico/<%= str_filename %>" width="16" height="16" 
title="<%= var_hints_34_35 %>" alt="<%= var_hints_34_35 %>"/></div></td>
<td width="10" bgcolor="<%= str_color_master %>" class="txtsmlisting">&nbsp;</td>
<td width="29" align="center" bgcolor="<%= str_color_master %>" class="txtsmlisting">&nbsp;</td>
<td width="13" bgcolor="<%= str_color_master %>" class="txtsmlisting">&nbsp;</td>
<td width="20" align="center" bgcolor="<%= str_color_master %>" class="txtsmlisting"><div align="center">
<% 
'If i_number_of_changes = 0 Then 
'20120318
If i_passiv_public = 1 Then'1=Active/2=Passive
%>
  <input type="checkbox" alt="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_24") %>" title="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_24") %>" name="<%=ckk_i_passive_x%>" value="checkbox"<%If i_passive = 1 Then%>CHECKED<%end if%> />
  <%else%>
  <input type="checkbox" name="checkbox_passiv" id="checkbox_passiv" title="<%= fc_value_string(Session("ses_i_language"), "var_meas_at_25") %>" disabled="disabled">
  <%End If%>
</div></td>
</tr>
<%

		str_measured_01 = 0
		str_measured_02 = 0
		str_measured_03 = 0
		
objRS.MoveNext
Loop

	objRS.Close
set objRS = Nothing

'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
'+++ Ende Andrey Info 07 +++
'+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

%>
</table>
<!-- <%= html %> -->
</td>
</tr>
</table>
</div>
</form>
<!--End of the second tab-->


<!--Third tab-->
<% 
'-------------------------------------------------------------------------
Dim sql_tmp_status
Dim str_fld_status

If Session("ses_i_language") = 1 Then'German
	sql_tmp_status = "SELECT i_k_status, str_status_de FROM tbl_0702_status Order by str_status_de"
	str_fld_status = "str_status_de"
end if

If Session("ses_i_language") = 2 Then'Eng
	sql_tmp_status = "SELECT i_k_status, str_status FROM tbl_0702_status Order by str_status"
	str_fld_status = "str_status"
end if


%>
<div id="page-enclosure-a3" style="display: none;">
<% 
tab3()
%>
</div>
<!--End of the third tab-->

</td>
</tr>
</table>
</td>
<td width="25"><p>&nbsp;</p>
</td>
</tr>
</table>
</td>

        <!-- InstanceEndEditable -->
<td width="25" valign="top">&nbsp;</td>
</tr>
</table></td>
</tr>
<tr>
<td width="950" height="71" valign="bottom" background="<%= fc_value_string(Session("ses_i_language"), "var_glob_bitm_21") %>" class="txtlegal"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="230">&nbsp;</td>
<td height="24" align="left" valign="top" class="txtsm11">
<table width="100%" border="0">
<tr>
<td width="84%" height="35" valign="top"><span class="txtlegal"><a href="contact_us.asp"><%= fc_value_string(Session("ses_i_language"), "var_glob_txt_07") %></a> | <a href="about.asp"><%= fc_value_string(Session("ses_i_language"), "var_glob_txt_08") %></a> | <a href="terms.asp"><%= fc_value_string(Session("ses_i_language"), "var_glob_txt_09") %></a> | <a href="terms.asp#disclaimer"><%= fc_value_string(Session("ses_i_language"), "var_glob_txt_10") %></a> | <a href="terms.asp#privacy"><%= fc_value_string(Session("ses_i_language"), "var_glob_txt_11") %></a> | </span>
<% If Session("ses_i_language") = 2 Then %>
<input name="btnSublanguage" type="image" onClick="javascript: change_language(1)" value="lang01" src="../App/images/country/flag_germany.png" align="middle" width="16" height="16" vspace="1" border="0"/>
<% end if %>
<% If Session("ses_i_language") = 1 Then %>
<input name="btnSublanguage" type="image" onclick="javascript: change_language(2)" value="lang02" src="../App/images/country/flag_usa.png" align="middle" width="16" height="16" vspace="1" border="0"/>
<% end if %>     
</td>
<td width="5%" height="35" valign="top">&nbsp;</td>
<td width="5%" height="35" valign="top">&nbsp;</td>
<td width="6%" height="35" valign="top">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
<%
	'call the background calculation if new measurement(s) were just saved
	If trancd = "S" Then
		Response.Write("<script type=""text/javascript"" language=""JavaScript"">runBgEstimation();</script>")
	End If
%>
</body>
<!-- InstanceEnd -->
<%
If bol_objConn = True Then           
        objConn.Close 
	set objConn = Nothing 
	bol_objConn = False
end if
%>
</html>
